@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:15.899Z") @Stability(value=Experimental) public interface CanaryProps extends software.amazon.jsii.JsiiSerializable
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_3_1)
.environmentVariables(Map.of(
"stage", "prod"))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CanaryProps.Builder
A builder for
CanaryProps |
static class |
CanaryProps.Jsii$Proxy
An implementation for
CanaryProps |
| Modifier and Type | Method and Description |
|---|---|
static CanaryProps.Builder |
builder() |
default ArtifactsBucketLocation |
getArtifactsBucketLocation()
(experimental) The s3 location that stores the data of the canary runs.
|
default String |
getCanaryName()
(experimental) The name of the canary.
|
default Map<String,String> |
getEnvironmentVariables()
(experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts.
|
default Duration |
getFailureRetentionPeriod()
(experimental) How many days should failed runs be retained.
|
default IRole |
getRole()
(experimental) Canary execution role.
|
Runtime |
getRuntime()
(experimental) Specify the runtime version to use for the canary.
|
default Schedule |
getSchedule()
(experimental) Specify the schedule for how often the canary runs.
|
default Boolean |
getStartAfterCreation()
(experimental) Whether or not the canary should start after creation.
|
default Duration |
getSuccessRetentionPeriod()
(experimental) How many days should successful runs be retained.
|
Test |
getTest()
(experimental) The type of test that you want your canary to run.
|
default Duration |
getTimeToLive()
(experimental) How long the canary will be in a 'RUNNING' state.
|
@Stability(value=Experimental) @NotNull Runtime getRuntime()
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library.html@Stability(value=Experimental) @NotNull Test getTest()
Use Test.custom() to specify the test to run.
@Stability(value=Experimental) @Nullable default ArtifactsBucketLocation getArtifactsBucketLocation()
Default: - A new s3 bucket will be created without a prefix.
@Stability(value=Experimental) @Nullable default String getCanaryName()
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
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html@Stability(value=Experimental) @Nullable default Map<String,String> getEnvironmentVariables()
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.
@Stability(value=Experimental) @Nullable default Duration getFailureRetentionPeriod()
Default: Duration.days(31)
@Stability(value=Experimental) @Nullable default IRole getRole()
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'.
permissions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn@Stability(value=Experimental) @Nullable default Schedule getSchedule()
For example, if you set schedule to rate(10 minutes), then the canary will run every 10 minutes.
You can set the schedule with Schedule.rate(Duration) (recommended) or you can specify an expression using Schedule.expression().
Default: 'rate(5 minutes)'
@Stability(value=Experimental) @Nullable default Boolean getStartAfterCreation()
Default: true
@Stability(value=Experimental) @Nullable default Duration getSuccessRetentionPeriod()
Default: Duration.days(31)
@Stability(value=Experimental) @Nullable default Duration getTimeToLive()
For example, if you set timeToLive to be 1 hour and schedule to be rate(10 minutes),
your canary will run at 10 minute intervals for an hour, for a total of 6 times.
Default: - no limit
@Stability(value=Experimental) static CanaryProps.Builder builder()
CanaryProps.Builder of CanaryPropsCopyright © 2022. All rights reserved.