StartCanaryDryRun
Use this operation to start a dry run for a canary that has already been created
Request Syntax
POST /canary/name
/dry-run/start 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
"
},
"EphemeralStorage": number
,
"MemoryInMB": number
,
"TimeoutInSeconds": number
},
"RuntimeVersion": "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 dry run. To find canary names, use DescribeCanaries.
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 Amazon S3 bucket can't include a period (.).
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- Code
-
Use this structure to input your script code for the canary. This structure contains the Lambda handler with the location where the canary should start running the script. If the script is stored in an Amazon S3 bucket, the bucket name, key, and version are also included. If the script was passed into the canary directly, the script code is contained in the value of
Zipfile
.If you are uploading your canary scripts with an Amazon S3 bucket, your zip file should include your script in a certain folder structure.
-
For Node.js canaries, the folder structure must be
nodejs/node_modules/myCanaryFilename.js
For more information, see Packaging your Node.js canary files -
For Python canaries, the folder structure must be
python/myCanaryFilename.py
orpython/myFolder/myCanaryFilename.py
For more information, see Packaging your Python canary files
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: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. 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.
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 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 theDeleteLambda
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 input information for a canary run.
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
- SuccessRetentionPeriodInDays
-
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.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 1024.
Required: No
- VisualReference
-
An object that specifies what screenshots to use as a baseline for visual monitoring by this canary. It can optionally also specify parts of the screenshots to ignore during the visual monitoring comparison.
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 subnets 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
Content-type: application/json
{
"DryRunConfig": {
"DryRunId": "string",
"LastDryRunExecutionStatus": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- DryRunConfig
-
Returns the dry run configurations for a canary.
Type: DryRunConfigOutput object
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
You don't have permission to perform this operation on this resource.
HTTP Status Code: 403
- ConflictException
-
A conflicting operation is already in progress.
HTTP Status Code: 409
- InternalServerException
-
An unknown internal error occurred.
HTTP Status Code: 500
- 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: