Class CfnCanaryPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.synthetics.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnCanaryPropsMixin cfnCanaryPropsMixin = CfnCanaryPropsMixin.Builder.create(CfnCanaryMixinProps.builder()
.artifactConfig(ArtifactConfigProperty.builder()
.s3Encryption(S3EncryptionProperty.builder()
.encryptionMode("encryptionMode")
.kmsKeyArn("kmsKeyArn")
.build())
.build())
.artifactS3Location("artifactS3Location")
.browserConfigs(List.of(BrowserConfigProperty.builder()
.browserType("browserType")
.build()))
.code(CodeProperty.builder()
.blueprintTypes(List.of("blueprintTypes"))
.dependencies(List.of(DependencyProperty.builder()
.reference("reference")
.type("type")
.build()))
.handler("handler")
.s3Bucket("s3Bucket")
.s3Key("s3Key")
.s3ObjectVersion("s3ObjectVersion")
.script("script")
.sourceLocationArn("sourceLocationArn")
.build())
.deleteLambdaResourcesOnCanaryDeletion(false)
.dryRunAndUpdate(false)
.executionRoleArn("executionRoleArn")
.failureRetentionPeriod(123)
.name("name")
.provisionedResourceCleanup("provisionedResourceCleanup")
.resourcesToReplicateTags(List.of("resourcesToReplicateTags"))
.runConfig(RunConfigProperty.builder()
.activeTracing(false)
.environmentVariables(Map.of(
"environmentVariablesKey", "environmentVariables"))
.ephemeralStorage(123)
.memoryInMb(123)
.timeoutInSeconds(123)
.build())
.runtimeVersion("runtimeVersion")
.schedule(ScheduleProperty.builder()
.durationInSeconds("durationInSeconds")
.expression("expression")
.retryConfig(RetryConfigProperty.builder()
.maxRetries(123)
.build())
.build())
.startCanaryAfterCreation(false)
.successRetentionPeriod(123)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.visualReference(VisualReferenceProperty.builder()
.baseCanaryRunId("baseCanaryRunId")
.baseScreenshots(List.of(BaseScreenshotProperty.builder()
.ignoreCoordinates(List.of("ignoreCoordinates"))
.screenshotName("screenshotName")
.build()))
.browserType("browserType")
.build())
.visualReferences(List.of(VisualReferenceProperty.builder()
.baseCanaryRunId("baseCanaryRunId")
.baseScreenshots(List.of(BaseScreenshotProperty.builder()
.ignoreCoordinates(List.of("ignoreCoordinates"))
.screenshotName("screenshotName")
.build()))
.browserType("browserType")
.build()))
.vpcConfig(VPCConfigProperty.builder()
.ipv6AllowedForDualStack(false)
.securityGroupIds(List.of("securityGroupIds"))
.subnetIds(List.of("subnetIds"))
.vpcId("vpcId")
.build())
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 .static interfaceA structure representing a screenshot that is used as a baseline during visual monitoring comparisons made by the canary.static interfaceA structure that specifies the browser type to use for a canary run.static final classA fluent builder forCfnCanaryPropsMixin.static interfaceUse this structure to input your script code for the canary.static interfaceA structure that contains information about a dependency for a canary.static interfaceThe canary's retry configuration information.static interfaceA structure that contains input information for a canary run.static interfaceA structure that contains the configuration of the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3 .static interfaceThis structure specifies how often a canary is to make runs and the date and time when it should stop making runs.static interfaceDefines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary.static interfaceIf this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::Synthetics::Canary.CfnCanaryPropsMixin(CfnCanaryMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Synthetics::Canary.protectedCfnCanaryPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCanaryPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnCanaryMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnCanaryPropsMixin
protected CfnCanaryPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnCanaryPropsMixin
protected CfnCanaryPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnCanaryPropsMixin
@Stability(Stable) public CfnCanaryPropsMixin(@NotNull CfnCanaryMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Synthetics::Canary.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnCanaryPropsMixin
Create a mixin to apply properties toAWS::Synthetics::Canary.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-