UpdateCanary - Amazon CloudWatch Synthetics

UpdateCanary

Updates the configuration of a canary that has already been created.

You can't use this operation to update the tags of an existing canary. To change the tags of an existing canary, use TagResource.

Request Syntax

PATCH /canary/name HTTP/1.1 Content-type: application/json { "ArtifactConfig": { "S3Encryption": { "EncryptionMode": "string", "KmsKeyArn": "string" } }, "ArtifactS3Location": "string", "Code": { "Handler": "string", "S3Bucket": "string", "S3Key": "string", "S3Version": "string", "ZipFile": blob }, "ExecutionRoleArn": "string", "FailureRetentionPeriodInDays": number, "ProvisionedResourceCleanup": "string", "RunConfig": { "ActiveTracing": boolean, "EnvironmentVariables": { "string" : "string" }, "MemoryInMB": number, "TimeoutInSeconds": number }, "RuntimeVersion": "string", "Schedule": { "DurationInSeconds": number, "Expression": "string" }, "SuccessRetentionPeriodInDays": number, "VisualReference": { "BaseCanaryRunId": "string", "BaseScreenshots": [ { "IgnoreCoordinates": [ "string" ], "ScreenshotName": "string" } ] }, "VpcConfig": { "Ipv6AllowedForDualStack": boolean, "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ] } }

URI Request Parameters

The request uses the following URI parameters.

name

The name of the canary that you want to update. To find the names of your canaries, use DescribeCanaries.

You cannot change the name of a canary that has already been created.

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: ^[0-9a-z_\-]+$

Required: Yes

Request Body

The request accepts the following data in JSON format.

ArtifactConfig

A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.

Type: ArtifactConfigInput object

Required: No

ArtifactS3Location

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 S3 bucket can't include a period (.).

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

Code

A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.

Type: CanaryCodeInput object

Required: No

ExecutionRoleArn

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:

  • s3:PutObject

  • s3:GetBucketLocation

  • s3:ListAllMyBuckets

  • cloudwatch:PutMetricData

  • logs:CreateLogGroup

  • logs:CreateLogStream

  • logs:CreateLogStream

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2048.

Pattern: arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+

Required: No

FailureRetentionPeriodInDays

The number of days to retain data about failed runs of this canary.

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

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1024.

Required: No

ProvisionedResourceCleanup

Specifies whether to also delete the Lambda functions and layers used by this canary 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.

Type: String

Valid Values: AUTOMATIC | OFF

Required: No

RunConfig

A structure that contains the timeout value that is used for each individual run of the canary.

Important

The environment variables keys and values are not encrypted. Do not store sensitive information in this field.

Type: CanaryRunConfigInput object

Required: No

RuntimeVersion

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.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

Schedule

A structure that contains information about how often the canary is to run, and when these runs are to stop.

Type: CanaryScheduleInput object

Required: No

SuccessRetentionPeriodInDays

The number of days to retain data about successful runs of this canary.

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

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1024.

Required: No

VisualReference

Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this parameter, no changes are made to any baseline screenshots that the canary might be using already.

Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see Visual monitoring and Visual monitoring blueprint

Type: VisualReferenceInput object

Required: No

VpcConfig

If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.

Type: VpcConfigInput object

Required: No

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

A conflicting operation is already in progress.

HTTP Status Code: 409

InternalServerException

An unknown internal error occurred.

HTTP Status Code: 500

RequestEntityTooLargeException

One of the input resources is larger than is allowed.

HTTP Status Code: 413

ResourceNotFoundException

One of the specified resources was not found.

HTTP Status Code: 404

ValidationException

A parameter could not be validated.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: