Interface CanaryProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CanaryProps.Jsii$Proxy
Example:
Canary canary = Canary.Builder.create(this, "MyCanary")
.schedule(Schedule.rate(Duration.minutes(5)))
.test(Test.custom(CustomTestOptions.builder()
.code(Code.fromAsset(join(__dirname, "canary")))
.handler("index.handler")
.build()))
.runtime(Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0)
.environmentVariables(Map.of(
"stage", "prod"))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCanaryPropsstatic final classAn implementation forCanaryProps -
Method Summary
Modifier and TypeMethodDescriptionstatic CanaryProps.Builderbuilder()default List<LifecycleRule>(experimental) Lifecycle rules for the generated canary artifact bucket.default ArtifactsBucketLocation(experimental) The s3 location that stores the data of the canary runs.default String(experimental) The name of the canary.default Cleanup(experimental) Specify the underlying resources to be cleaned up when the canary is deleted.default BooleanDeprecated.(experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts.default Duration(experimental) How many days should failed runs be retained.default IRolegetRole()(experimental) Canary execution role.(experimental) Specify the runtime version to use for the canary.default Schedule(experimental) Specify the schedule for how often the canary runs.default List<ISecurityGroup>(experimental) The list of security groups to associate with the canary's network interfaces.default Boolean(experimental) Whether or not the canary should start after creation.default Duration(experimental) How many days should successful runs be retained.getTest()(experimental) The type of test that you want your canary to run.default Duration(experimental) How long the canary will be in a 'RUNNING' state.default IVpcgetVpc()(experimental) The VPC where this canary is run.default SubnetSelection(experimental) Where to place the network interfaces within the VPC.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getRuntime
(experimental) Specify the runtime version to use for the canary.- See Also:
-
getTest
(experimental) The type of test that you want your canary to run.Use
Test.custom()to specify the test to run. -
getArtifactsBucketLifecycleRules
(experimental) Lifecycle rules for the generated canary artifact bucket.Has no effect if a bucket is passed to
artifactsBucketLocation. If you pass a bucket toartifactsBucketLocation, you can add lifecycle rules to the bucket itself.Default: - no rules applied to the generated bucket.
-
getArtifactsBucketLocation
(experimental) The s3 location that stores the data of the canary runs.Default: - A new s3 bucket will be created without a prefix.
-
getCanaryName
(experimental) The name of the 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 name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet.
Default: - A unique name will be generated from the construct ID
- See Also:
-
getCleanup
(experimental) Specify the underlying resources to be cleaned up when the canary is deleted.Using
Cleanup.LAMBDAwill create a Custom Resource to achieve this.Default: Cleanup.NOTHING
-
getEnableAutoDeleteLambdas
Deprecated.this feature has been deprecated by the service team, usecleanup: Cleanup.LAMBDAinstead which will use a Custom Resource to achieve the same effect.(deprecated) Whether or not to delete the lambda resources when the canary is deleted.Default: false
- See Also:
-
getEnvironmentVariables
(experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts.Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Canary script source code.
Default: - No environment variables.
-
getFailureRetentionPeriod
(experimental) How many days should failed runs be retained.Default: Duration.days(31)
-
getRole
(experimental) Canary execution role.This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal.
If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions.
Default: - A unique role will be generated for this canary. You can add permissions to roles by calling 'addToRolePolicy'.
- See Also:
-
getSchedule
(experimental) Specify the schedule for how often the canary runs.For example, if you set
scheduletorate(10 minutes), then the canary will run every 10 minutes. You can set the schedule withSchedule.rate(Duration)(recommended) or you can specify an expression usingSchedule.expression().Default: 'rate(5 minutes)'
-
getSecurityGroups
(experimental) The list of security groups to associate with the canary's network interfaces.You must provide
vpcwhen using this prop.Default: - If the canary is placed within a VPC and a security group is not specified a dedicated security group will be created for this canary.
-
getStartAfterCreation
(experimental) Whether or not the canary should start after creation.Default: true
-
getSuccessRetentionPeriod
(experimental) How many days should successful runs be retained.Default: Duration.days(31)
-
getTimeToLive
(experimental) How long the canary will be in a 'RUNNING' state.For example, if you set
timeToLiveto be 1 hour andscheduleto berate(10 minutes), your canary will run at 10 minute intervals for an hour, for a total of 6 times.Default: - no limit
-
getVpc
(experimental) The VPC where this canary is run.Specify this if the canary needs to access resources in a VPC.
Default: - Not in VPC
-
getVpcSubnets
(experimental) Where to place the network interfaces within the VPC.You must provide
vpcwhen using this prop.Default: - the Vpc default strategy if not specified
-
builder
- Returns:
- a
CanaryProps.BuilderofCanaryProps
-
cleanup: Cleanup.LAMBDAinstead which will use a Custom Resource to achieve the same effect.