Class CanaryProps
(experimental) Properties for a canary.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Synthetics
Assembly: Amazon.CDK.AWS.Synthetics.dll
Syntax (csharp)
public class CanaryProps : Object, ICanaryProps
Syntax (vb)
Public Class CanaryProps
Inherits Object
Implements ICanaryProps
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
var canary = new Canary(this, "MyCanary", new CanaryProps {
Schedule = Schedule.Rate(Duration.Minutes(5)),
Test = Test.Custom(new CustomTestOptions {
Code = Code.FromAsset(Join(__dirname, "canary")),
Handler = "index.handler"
}),
Runtime = Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_1,
EnvironmentVariables = new Dictionary<string, string> {
{ "stage", "prod" }
}
});
Synopsis
Constructors
CanaryProps() |
Properties
ArtifactsBucketLocation | (experimental) The s3 location that stores the data of the canary runs. |
CanaryName | (experimental) The name of the canary. |
EnvironmentVariables | (experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts. |
FailureRetentionPeriod | (experimental) How many days should failed runs be retained. |
Role | (experimental) Canary execution role. |
Runtime | (experimental) Specify the runtime version to use for the canary. |
Schedule | (experimental) Specify the schedule for how often the canary runs. |
SecurityGroups | (experimental) The list of security groups to associate with the canary's network interfaces. |
StartAfterCreation | (experimental) Whether or not the canary should start after creation. |
SuccessRetentionPeriod | (experimental) How many days should successful runs be retained. |
Test | (experimental) The type of test that you want your canary to run. |
TimeToLive | (experimental) How long the canary will be in a 'RUNNING' state. |
Vpc | (experimental) The VPC where this canary is run. |
VpcSubnets | (experimental) Where to place the network interfaces within the VPC. |
Constructors
CanaryProps()
public CanaryProps()
Properties
ArtifactsBucketLocation
(experimental) The s3 location that stores the data of the canary runs.
public IArtifactsBucketLocation ArtifactsBucketLocation { get; set; }
Property Value
Remarks
Default: - A new s3 bucket will be created without a prefix.
Stability: Experimental
CanaryName
(experimental) The name of the canary.
public string CanaryName { get; set; }
Property Value
System.String
Remarks
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
Stability: Experimental
See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html
EnvironmentVariables
(experimental) Key-value pairs that the Synthetics caches and makes available for your canary scripts.
public IDictionary<string, string> EnvironmentVariables { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
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: Experimental
FailureRetentionPeriod
(experimental) How many days should failed runs be retained.
public Duration FailureRetentionPeriod { get; set; }
Property Value
Remarks
Default: Duration.days(31)
Stability: Experimental
Role
(experimental) Canary execution role.
public IRole Role { get; set; }
Property Value
Remarks
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'.
Stability: Experimental
See: required permissions: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html#cfn-synthetics-canary-executionrolearn
Runtime
(experimental) Specify the runtime version to use for the canary.
public Runtime Runtime { get; set; }
Property Value
Remarks
Stability: Experimental
Schedule
(experimental) Specify the schedule for how often the canary runs.
public Schedule Schedule { get; set; }
Property Value
Remarks
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: Experimental
SecurityGroups
(experimental) The list of security groups to associate with the canary's network interfaces.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
You must provide vpc
when 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.
Stability: Experimental
StartAfterCreation
(experimental) Whether or not the canary should start after creation.
public Nullable<bool> StartAfterCreation { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
Stability: Experimental
SuccessRetentionPeriod
(experimental) How many days should successful runs be retained.
public Duration SuccessRetentionPeriod { get; set; }
Property Value
Remarks
Default: Duration.days(31)
Stability: Experimental
Test
(experimental) The type of test that you want your canary to run.
public Test Test { get; set; }
Property Value
Remarks
Use Test.custom()
to specify the test to run.
Stability: Experimental
TimeToLive
(experimental) How long the canary will be in a 'RUNNING' state.
public Duration TimeToLive { get; set; }
Property Value
Remarks
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: Experimental
Vpc
(experimental) The VPC where this canary is run.
public IVpc Vpc { get; set; }
Property Value
Remarks
Specify this if the canary needs to access resources in a VPC.
Default: - Not in VPC
Stability: Experimental
VpcSubnets
(experimental) Where to place the network interfaces within the VPC.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
You must provide vpc
when using this prop.
Default: - the Vpc default strategy if not specified
Stability: Experimental