AWS::Synthetics::Canary 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 S3 bucket, the bucket name, key, and version are also included.
If
the script is passed into the canary directly, the script code is contained in the
value
of Script
.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Handler" :
String
, "S3Bucket" :String
, "S3Key" :String
, "S3ObjectVersion" :String
, "Script" :String
}
YAML
Handler:
String
S3Bucket:String
S3Key:String
S3ObjectVersion:String
Script:String
Properties
Handler
-
The entry point to use for the source code when running the canary. This value must end with the string
.handler
. The string is limited to 29 characters or fewer.Required: Conditional
Type: String
Minimum:
1
Maximum:
1024
Update requires: No interruption
S3Bucket
-
If your canary script is located in S3, specify the bucket name here. The bucket must already exist.
Required: Conditional
Type: String
Minimum:
1
Maximum:
1024
Update requires: No interruption
S3Key
-
The S3 key of your script. For more information, see Working with Amazon S3 Objects.
Required: Conditional
Type: String
Minimum:
1
Maximum:
1024
Update requires: No interruption
S3ObjectVersion
-
The S3 version ID of your script.
Required: Conditional
Type: String
Minimum:
1
Maximum:
1024
Update requires: No interruption
Script
-
If you input your canary script directly into the canary instead of referring to an S3 location, the value of this parameter is the script in plain text. It can be up to 5 MB.
Required: Conditional
Type: String
Update requires: No interruption