Skip to content

start_canary_dry_run

start_canary_dry_run(
    name: CanaryName,
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    code: Optional[CanaryCodeInput] = None,
    runtime_version: Optional[String] = None,
    run_config: Optional[CanaryRunConfigInput] = None,
    vpc_config: Optional[VpcConfigInput] = None,
    execution_role_arn: Optional[RoleArn] = None,
    success_retention_period_in_days: Optional[MaxSize1024] = None,
    failure_retention_period_in_days: Optional[MaxSize1024] = None,
    visual_reference: Optional[VisualReferenceInput] = None,
    artifact_s3_location: Optional[String] = None,
    artifact_config: Optional[ArtifactConfigInput] = None,
    provisioned_resource_cleanup: Optional[ProvisionedResourceCleanupSetting] = None,
    browser_configs: Optional[BrowserConfigs] = None,
    visual_references: Optional[VisualReferences] = None,
) -> StartCanaryDryRunResponse

Use this operation to start a dry run for a canary that has already been created

Parameters:

  • name (CanaryName) –

    The name of the canary that you want to dry run. To find canary names, use DescribeCanaries.

  • runtime_version (Optional[String], default: None ) –

    Specifies the runtime version to use for the canary. For a list of valid runtime versions and for more information about runtime versions, see Canary Runtime Versions.

  • execution_role_arn (Optional[RoleArn], default: None ) –

    The ARN of the IAM role to be used to run the canary. This role must already exist, and must include lambda.amazonaws.com as a principal in the trust policy. The role must also have the following permissions:

  • success_retention_period_in_days (Optional[MaxSize1024], default: None ) –

    The number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.

    This setting affects the range of information returned by GetCanaryRuns, as well as the range of information displayed in the Synthetics console.

  • failure_retention_period_in_days (Optional[MaxSize1024], default: None ) –

    The number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.

    This setting affects the range of information returned by GetCanaryRuns, as well as the range of information displayed in the Synthetics console.

  • artifact_s3_location (Optional[String], default: None ) –

    The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the Amazon S3 bucket can't include a period (.).

  • provisioned_resource_cleanup (Optional[ProvisionedResourceCleanupSetting], default: None ) –

    Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of AUTOMATIC is used, which means that the Lambda functions and layers will be deleted when the canary is deleted.

    If the value of this parameter is OFF, then the value of the DeleteLambda parameter of the DeleteCanary operation determines whether the Lambda functions and layers will be deleted.

  • browser_configs (Optional[BrowserConfigs], default: None ) –

    A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both CHROME and FIREFOX browsers.

    If not specified, browserConfigs defaults to Chrome.

  • visual_references (Optional[VisualReferences], default: None ) –

    A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.

    syn-nodejs-puppeteer-11.0 and above, and syn-nodejs-playwright-3.0 and above, only supports visualReferences. visualReference field is not supported.

    Versions older than syn-nodejs-puppeteer-11.0 supports both visualReference and visualReferences for backward compatibility. It is recommended to use visualReferences for consistency and future compatibility.

Raises:

Source code in docs_src/capo_synthetics/_services/synthetics.py
def start_canary_dry_run(
    self,
    name: "capo_synthetics.types.canary_name.CanaryName",
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    code: Optional[
        "capo_synthetics.types.canary_code_input.CanaryCodeInput"
    ] = None,
    runtime_version: Optional["capo_synthetics.types.string.String"] = None,
    run_config: Optional[
        "capo_synthetics.types.canary_run_config_input.CanaryRunConfigInput"
    ] = None,
    vpc_config: Optional[
        "capo_synthetics.types.vpc_config_input.VpcConfigInput"
    ] = None,
    execution_role_arn: Optional["capo_synthetics.types.role_arn.RoleArn"] = None,
    success_retention_period_in_days: Optional[
        "capo_synthetics.types.max_size1024.MaxSize1024"
    ] = None,
    failure_retention_period_in_days: Optional[
        "capo_synthetics.types.max_size1024.MaxSize1024"
    ] = None,
    visual_reference: Optional[
        "capo_synthetics.types.visual_reference_input.VisualReferenceInput"
    ] = None,
    artifact_s3_location: Optional["capo_synthetics.types.string.String"] = None,
    artifact_config: Optional[
        "capo_synthetics.types.artifact_config_input.ArtifactConfigInput"
    ] = None,
    provisioned_resource_cleanup: Optional[
        "capo_synthetics.types.provisioned_resource_cleanup_setting.ProvisionedResourceCleanupSetting"
    ] = None,
    browser_configs: Optional[
        "capo_synthetics.types.browser_configs.BrowserConfigs"
    ] = None,
    visual_references: Optional[
        "capo_synthetics.types.visual_references.VisualReferences"
    ] = None,
) -> (
    "capo_synthetics.types.start_canary_dry_run_response.StartCanaryDryRunResponse"
):
    """<p>Use this operation to start a dry run for a canary that has already been created</p>

    Args:
        name: <p>The name of the canary that you want to dry run. To find canary names, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html">DescribeCanaries</a>.</p>
        runtime_version: <p>Specifies the runtime version to use for the canary. For a list of valid runtime versions and for more information about runtime versions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html"> Canary Runtime Versions</a>.</p>
        execution_role_arn: <p>The ARN of the IAM role to be used to run the canary. This role must already exist, and must include <code>lambda.amazonaws.com</code> as a principal in the trust policy. The role must also have the following permissions:</p>
        success_retention_period_in_days: <p>The number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.</p> <p>This setting affects the range of information returned by <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanaryRuns.html">GetCanaryRuns</a>, as well as the range of information displayed in the Synthetics console. </p>
        failure_retention_period_in_days: <p>The number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.</p> <p>This setting affects the range of information returned by <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanaryRuns.html">GetCanaryRuns</a>, as well as the range of information displayed in the Synthetics console. </p>
        artifact_s3_location: <p>The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the Amazon S3 bucket can't include a period (.).</p>
        provisioned_resource_cleanup: <p>Specifies whether to also delete the Lambda functions and layers used by this canary when the canary is deleted. If you omit this parameter, the default of <code>AUTOMATIC</code> is used, which means that the Lambda functions and layers will be deleted when the canary is deleted.</p> <p>If the value of this parameter is <code>OFF</code>, then the value of the <code>DeleteLambda</code> parameter of the <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DeleteCanary.html">DeleteCanary</a> operation determines whether the Lambda functions and layers will be deleted.</p>
        browser_configs: <p>A structure that specifies the browser type to use for a canary run. CloudWatch Synthetics supports running canaries on both <code>CHROME</code> and <code>FIREFOX</code> browsers.</p> <note> <p>If not specified, <code>browserConfigs</code> defaults to Chrome.</p> </note>
        visual_references: <p>A list of visual reference configurations for the canary, one for each browser type that the canary is configured to run on. Visual references are used for visual monitoring comparisons.</p> <p> <code>syn-nodejs-puppeteer-11.0</code> and above, and <code>syn-nodejs-playwright-3.0</code> and above, only supports <code>visualReferences</code>. <code>visualReference</code> field is not supported.</p> <p>Versions older than <code>syn-nodejs-puppeteer-11.0</code> supports both <code>visualReference</code> and <code>visualReferences</code> for backward compatibility. It is recommended to use <code>visualReferences</code> for consistency and future compatibility.</p>

    Raises:
        capo_synthetics.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform this operation on this resource.</p>
        capo_synthetics.errors.conflict_exception.ConflictException: <p>A conflicting operation is already in progress.</p>
        capo_synthetics.errors.internal_server_exception.InternalServerException: <p>An unknown internal error occurred.</p>
        capo_synthetics.errors.resource_not_found_exception.ResourceNotFoundException: <p>One of the specified resources was not found.</p>
        capo_synthetics.errors.validation_exception.ValidationException: <p>A parameter could not be validated.</p>
        capo_synthetics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_synthetics.types.start_canary_dry_run_request.StartCanaryDryRunRequest]",
    ) -> OperationResponse[
        "capo_synthetics.types.start_canary_dry_run_response.StartCanaryDryRunResponse"
    ]:
        import capo_synthetics._operations.synthetics.start_canary_dry_run

        output, http_response = (
            capo_synthetics._operations.synthetics.start_canary_dry_run.start_canary_dry_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCanaryDryRun")
    )
    input_: capo_synthetics.types.start_canary_dry_run_request.StartCanaryDryRunRequest = {
        "name": name
    }
    if code is not None:
        input_["code"] = code
    if runtime_version is not None:
        input_["runtime_version"] = runtime_version
    if run_config is not None:
        input_["run_config"] = run_config
    if vpc_config is not None:
        input_["vpc_config"] = vpc_config
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn
    if success_retention_period_in_days is not None:
        input_["success_retention_period_in_days"] = (
            success_retention_period_in_days
        )
    if failure_retention_period_in_days is not None:
        input_["failure_retention_period_in_days"] = (
            failure_retention_period_in_days
        )
    if visual_reference is not None:
        input_["visual_reference"] = visual_reference
    if artifact_s3_location is not None:
        input_["artifact_s3_location"] = artifact_s3_location
    if artifact_config is not None:
        input_["artifact_config"] = artifact_config
    if provisioned_resource_cleanup is not None:
        input_["provisioned_resource_cleanup"] = provisioned_resource_cleanup
    if browser_configs is not None:
        input_["browser_configs"] = browser_configs
    if visual_references is not None:
        input_["visual_references"] = visual_references

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output