java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.synthetics.CfnCanaryPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-14T18:32:19.864Z") @Stability(Stable) public class CfnCanaryPropsMixin extends Mixin implements software.constructs.IMixin
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 .

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:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> 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 to AWS::Synthetics::Canary.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnCanaryPropsMixin

      @Stability(Stable) public CfnCanaryPropsMixin(@NotNull CfnCanaryMixinProps props)
      Create a mixin to apply properties to AWS::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.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnCanaryMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()