class CfnCanaryPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.Synthetics.Mixins.CfnCanaryPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awssynthetics/mixins#CfnCanaryPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.synthetics.mixins.CfnCanaryPropsMixin |
Python | aws_cdk.mixins_preview.aws_synthetics.mixins.CfnCanaryPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_synthetics » mixins » CfnCanaryPropsMixin |
Implements
IMixin
Extends
Mixin
Creates or updates a canary.
Canaries are scripts that monitor your endpoints and APIs from the outside-in. Canaries help you check the availability and latency of your web services and troubleshoot anomalies by investigating load time data, screenshots of the UI, logs, and metrics. You can set up a canary to run continuously or just once.
Canaries are automated scripts that run at specified intervals against an endpoint. They include Python or Node.js code to create a Lambda function. This code needs to be packaged in a certain way, depending on the language. For more information, see Writing a canary script .
To create canaries, you must have the CloudWatchSyntheticsFullAccess policy. If you are creating a new IAM role for the canary, you also need the the iam:CreateRole , iam:CreatePolicy and iam:AttachRolePolicy permissions. For more information, see Necessary Roles and Permissions .
Do not include secrets or proprietary information in your canary names. The canary name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-synthetics-canary.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as synthetics_mixins } from '@aws-cdk/mixins-preview/aws-synthetics';
const cfnCanaryPropsMixin = new synthetics_mixins.CfnCanaryPropsMixin({
artifactConfig: {
s3Encryption: {
encryptionMode: 'encryptionMode',
kmsKeyArn: 'kmsKeyArn',
},
},
artifactS3Location: 'artifactS3Location',
browserConfigs: [{
browserType: 'browserType',
}],
code: {
blueprintTypes: ['blueprintTypes'],
dependencies: [{
reference: 'reference',
type: 'type',
}],
handler: 'handler',
s3Bucket: 's3Bucket',
s3Key: 's3Key',
s3ObjectVersion: 's3ObjectVersion',
script: 'script',
sourceLocationArn: 'sourceLocationArn',
},
deleteLambdaResourcesOnCanaryDeletion: false,
dryRunAndUpdate: false,
executionRoleArn: 'executionRoleArn',
failureRetentionPeriod: 123,
name: 'name',
provisionedResourceCleanup: 'provisionedResourceCleanup',
resourcesToReplicateTags: ['resourcesToReplicateTags'],
runConfig: {
activeTracing: false,
environmentVariables: {
environmentVariablesKey: 'environmentVariables',
},
ephemeralStorage: 123,
memoryInMb: 123,
timeoutInSeconds: 123,
},
runtimeVersion: 'runtimeVersion',
schedule: {
durationInSeconds: 'durationInSeconds',
expression: 'expression',
retryConfig: {
maxRetries: 123,
},
},
startCanaryAfterCreation: false,
successRetentionPeriod: 123,
tags: [{
key: 'key',
value: 'value',
}],
visualReference: {
baseCanaryRunId: 'baseCanaryRunId',
baseScreenshots: [{
ignoreCoordinates: ['ignoreCoordinates'],
screenshotName: 'screenshotName',
}],
browserType: 'browserType',
},
visualReferences: [{
baseCanaryRunId: 'baseCanaryRunId',
baseScreenshots: [{
ignoreCoordinates: ['ignoreCoordinates'],
screenshotName: 'screenshotName',
}],
browserType: 'browserType',
}],
vpcConfig: {
ipv6AllowedForDualStack: false,
securityGroupIds: ['securityGroupIds'],
subnetIds: ['subnetIds'],
vpcId: 'vpcId',
},
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnCanaryPropsMixin(props: CfnCanaryMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Canary Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::Synthetics::Canary.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript