Class CfnCanary.CodeProperty
Use this structure to input your script code for the canary.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Synthetics
Assembly: Amazon.CDK.AWS.Synthetics.dll
Syntax (csharp)
public class CodeProperty : Object, CfnCanary.ICodeProperty
Syntax (vb)
Public Class CodeProperty
Inherits Object
Implements CfnCanary.ICodeProperty
Remarks
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
.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Synthetics;
var codeProperty = new CodeProperty {
Handler = "handler",
// the properties below are optional
S3Bucket = "s3Bucket",
S3Key = "s3Key",
S3ObjectVersion = "s3ObjectVersion",
Script = "script",
SourceLocationArn = "sourceLocationArn"
};
Synopsis
Constructors
CodeProperty() |
Properties
Handler | The entry point to use for the source code when running the canary. |
S3Bucket | If your canary script is located in S3, specify the bucket name here. |
S3Key | The S3 key of your script. |
S3ObjectVersion | The S3 version ID of your script. |
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. |
SourceLocationArn | The ARN of the Lambda layer where Synthetics stores the canary script code. |
Constructors
CodeProperty()
public CodeProperty()
Properties
Handler
The entry point to use for the source code when running the canary.
public string Handler { get; set; }
Property Value
System.String
Remarks
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
.
S3Bucket
If your canary script is located in S3, specify the bucket name here.
public string S3Bucket { get; set; }
Property Value
System.String
Remarks
The bucket must already exist.
S3Key
The S3 key of your script.
public string S3Key { get; set; }
Property Value
System.String
Remarks
S3ObjectVersion
The S3 version ID of your script.
public string S3ObjectVersion { get; set; }
Property Value
System.String
Remarks
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.
public string Script { get; set; }
Property Value
System.String
Remarks
SourceLocationArn
The ARN of the Lambda layer where Synthetics stores the canary script code.
public string SourceLocationArn { get; set; }
Property Value
System.String