@Stability(value=Stable)
public static interface CfnCanary.CodeProperty
extends software.amazon.jsii.JsiiSerializable
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()
.handler("handler")
// the properties below are optional
.s3Bucket("s3Bucket")
.s3Key("s3Key")
.s3ObjectVersion("s3ObjectVersion")
.script("script")
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnCanary.CodeProperty.Builder
A builder for
CfnCanary.CodeProperty |
static class |
CfnCanary.CodeProperty.Jsii$Proxy
An implementation for
CfnCanary.CodeProperty |
| Modifier and Type | Method and Description |
|---|---|
static CfnCanary.CodeProperty.Builder |
builder() |
String |
getHandler()
The entry point to use for the source code when running the canary.
|
default String |
getS3Bucket()
If your canary script is located in S3, specify the bucket name here.
|
default String |
getS3Key()
The S3 key of your script.
|
default String |
getS3ObjectVersion()
The S3 version ID of your script.
|
default String |
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.
|
@Stability(value=Stable) @NotNull String getHandler()
For canaries that use the syn-python-selenium-1.0 runtime or a syn-nodejs.puppeteer runtime earlier than syn-nodejs.puppeteer-3.4 , the handler must be specified as *fileName* .handler . For syn-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* .
@Stability(value=Stable) @Nullable default String getS3Bucket()
The bucket must already exist.
@Stability(value=Stable) @Nullable default String getS3Key()
For more information, see Working with Amazon S3 Objects .
@Stability(value=Stable) @Nullable default String getS3ObjectVersion()
@Stability(value=Stable) @Nullable default String getScript()
It can be up to 5 MB.
@Stability(value=Stable) static CfnCanary.CodeProperty.Builder builder()
CfnCanary.CodeProperty.Builder of CfnCanary.CodePropertyCopyright © 2022. All rights reserved.