Interface CfnCanaryProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnCanaryProps.Jsii$Proxy
CfnCanary
.
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.*; CfnCanaryProps cfnCanaryProps = CfnCanaryProps.builder() .artifactS3Location("artifactS3Location") .code(CodeProperty.builder() .handler("handler") // the properties below are optional .s3Bucket("s3Bucket") .s3Key("s3Key") .s3ObjectVersion("s3ObjectVersion") .script("script") .sourceLocationArn("sourceLocationArn") .build()) .executionRoleArn("executionRoleArn") .name("name") .runtimeVersion("runtimeVersion") .schedule(ScheduleProperty.builder() .expression("expression") // the properties below are optional .durationInSeconds("durationInSeconds") .build()) // the properties below are optional .artifactConfig(ArtifactConfigProperty.builder() .s3Encryption(S3EncryptionProperty.builder() .encryptionMode("encryptionMode") .kmsKeyArn("kmsKeyArn") .build()) .build()) .deleteLambdaResourcesOnCanaryDeletion(false) .failureRetentionPeriod(123) .runConfig(RunConfigProperty.builder() .activeTracing(false) .environmentVariables(Map.of( "environmentVariablesKey", "environmentVariables")) .memoryInMb(123) .timeoutInSeconds(123) .build()) .startCanaryAfterCreation(false) .successRetentionPeriod(123) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .visualReference(VisualReferenceProperty.builder() .baseCanaryRunId("baseCanaryRunId") // the properties below are optional .baseScreenshots(List.of(BaseScreenshotProperty.builder() .screenshotName("screenshotName") // the properties below are optional .ignoreCoordinates(List.of("ignoreCoordinates")) .build())) .build()) .vpcConfig(VPCConfigProperty.builder() .securityGroupIds(List.of("securityGroupIds")) .subnetIds(List.of("subnetIds")) // the properties below are optional .vpcId("vpcId") .build()) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forCfnCanaryProps
static final class
An implementation forCfnCanaryProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic CfnCanaryProps.Builder
builder()
default Object
A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary.getCode()
Use this structure to input your script code for the canary.default Object
AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
.The ARN of the IAM role to be used to run the canary.default Number
The number of days to retain data about failed runs of this canary.getName()
The name for this canary.default Object
A structure that contains input information for a canary run.Specifies the runtime version to use for the canary.A structure that contains information about how often the canary is to run, and when these runs are to stop.default Object
Specify TRUE to have the canary start making runs immediately after it is created.default Number
The number of days to retain data about successful runs of this canary.getTags()
The list of key-value pairs that are associated with the canary.default Object
If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison.default Object
If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getArtifactS3Location
The location in Amazon S3 where Synthetics stores artifacts from the runs of this canary.Artifacts include the log file, screenshots, and HAR files. Specify the full location path, including
s3://
at the beginning of the path. -
getCode
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
. -
getExecutionRoleArn
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:s3:PutObject
s3:GetBucketLocation
s3:ListAllMyBuckets
cloudwatch:PutMetricData
logs:CreateLogGroup
logs:CreateLogStream
logs:PutLogEvents
-
getName
The name for this canary.Be sure to give it a descriptive name that distinguishes it from other canaries in your account.
Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries .
-
getRuntimeVersion
Specifies the runtime version to use for the canary.For more information about runtime versions, see Canary Runtime Versions .
-
getSchedule
A structure that contains information about how often the canary is to run, and when these runs are to stop. -
getArtifactConfig
A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3. -
getDeleteLambdaResourcesOnCanaryDeletion
AWS::Synthetics::Canary.DeleteLambdaResourcesOnCanaryDeletion
. -
getFailureRetentionPeriod
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.
-
getRunConfig
A structure that contains input information for a canary run.If you omit this structure, the frequency of the canary is used as canary's timeout value, up to a maximum of 900 seconds.
-
getStartCanaryAfterCreation
Specify TRUE to have the canary start making runs immediately after it is created.A canary that you create using CloudFormation can't be used to monitor the CloudFormation stack that creates the canary or to roll back that stack if there is a failure.
-
getSuccessRetentionPeriod
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.
-
getTags
The list of key-value pairs that are associated with the canary. -
getVisualReference
If this canary performs visual monitoring by comparing screenshots, this structure contains the ID of the canary run to use as the baseline for screenshots, and the coordinates of any parts of the screen to ignore during the visual monitoring comparison. -
getVpcConfig
If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.For more information, see Running a Canary in a VPC .
-
builder
- Returns:
- a
CfnCanaryProps.Builder
ofCfnCanaryProps
-