Interface CfnCanary.CodeProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnCanary.CodeProperty.Jsii$Proxy
- Enclosing class:
CfnCanary
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.synthetics.*;
CodeProperty codeProperty = CodeProperty.builder()
.blueprintTypes(List.of("blueprintTypes"))
.dependencies(List.of(DependencyProperty.builder()
.reference("reference")
// the properties below are optional
.type("type")
.build()))
.handler("handler")
.s3Bucket("s3Bucket")
.s3Key("s3Key")
.s3ObjectVersion("s3ObjectVersion")
.script("script")
.sourceLocationArn("sourceLocationArn")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnCanary.CodePropertystatic final classAn implementation forCfnCanary.CodeProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()BlueprintTypesare a list of templates that enable simplified canary creation.default ObjectList of Lambda layers to attach to the canary.default StringThe entry point to use for the source code when running the canary.default StringIf your canary script is located in S3, specify the bucket name here.default StringgetS3Key()The Amazon S3 key of your script.default StringThe Amazon S3 version ID of your script.default StringIf 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.default StringThe ARN of the Lambda layer where Synthetics stores the canary script code.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getBlueprintTypes
BlueprintTypesare a list of templates that enable simplified canary creation.You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts.
multi-checksis the only supported value.When you specify
BlueprintTypes, theHandlerfield cannot be specified since the blueprint provides a pre-defined entry point.- See Also:
-
getDependencies
List of Lambda layers to attach to the canary.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnCanary.DependencyProperty>- See Also:
-
getHandler
The entry point to use for the source code when running the canary.For canaries that use the
syn-python-selenium-1.0runtime or asyn-nodejs.puppeteerruntime earlier thansyn-nodejs.puppeteer-3.4, the handler must be specified as*fileName* .handler. Forsyn-python-selenium-1.1,syn-nodejs.puppeteer-3.4, and later runtimes, the handler can be specified as*fileName* . *functionName*, or you can specify a folder where canary scripts reside as*folder* / *fileName* . *functionName*.This field is required when you don't specify
BlueprintTypesand is not allowed when you specifyBlueprintTypes.- See Also:
-
getS3Bucket
If your canary script is located in S3, specify the bucket name here.The bucket must already exist.
- See Also:
-
getS3Key
The Amazon S3 key of your script.For more information, see Working with Amazon S3 Objects .
- See Also:
-
getS3ObjectVersion
The Amazon S3 version ID of your script.- See Also:
-
getScript
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.
- See Also:
-
getSourceLocationArn
The ARN of the Lambda layer where Synthetics stores the canary script code.- See Also:
-
builder
- Returns:
- a
CfnCanary.CodeProperty.BuilderofCfnCanary.CodeProperty
-