Class Canary
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.synthetics.Canary
- All Implemented Interfaces:
IEnvironmentAware,ICanaryRef,IResource,IConnectable,ICanary,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-04-24T20:29:38.565Z")
@Stability(Stable)
public class Canary
extends Resource
implements IConnectable, ICanary
Define a new Canary.
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_7_0)
.resourcesToReplicateTags(List.of(ResourceToReplicateTags.LAMBDA_FUNCTION))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.synthetics.ICanary
ICanary.Jsii$Default, ICanary.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IConnectable
IConnectable.Jsii$Default, IConnectable.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCanary(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCanary(software.amazon.jsii.JsiiObjectRef objRef) Canary(software.constructs.Construct scope, String id, CanaryProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic ICanaryfromCanaryArn(software.constructs.Construct scope, String id, String canaryArn) Import an existing canary by ARN.static ICanaryfromCanaryName(software.constructs.Construct scope, String id, String canaryName) Import an existing canary by name.Bucket where data from each canary run is stored.The canary ARN.The canary ID.The canary Name.A reference to the canary.The state of the canary.Access the Connections object.getRole()Execution role associated with this Canary.Measure the Duration of a single canary run, in seconds.metricDuration(MetricOptions options) Measure the Duration of a single canary run, in seconds.Measure the number of failed canary runs over a given time period.metricFailed(MetricOptions options) Measure the number of failed canary runs over a given time period.Measure the percentage of successful canary runs.metricSuccessPercent(MetricOptions options) Measure the percentage of successful canary runs.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
Canary
protected Canary(software.amazon.jsii.JsiiObjectRef objRef) -
Canary
protected Canary(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Canary
@Stability(Stable) public Canary(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CanaryProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromCanaryArn
@Stability(Stable) @NotNull public static ICanary fromCanaryArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String canaryArn) Import an existing canary by ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.canaryArn- This parameter is required.
-
fromCanaryName
@Stability(Stable) @NotNull public static ICanary fromCanaryName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String canaryName) Import an existing canary by name.- Parameters:
scope- This parameter is required.id- This parameter is required.canaryName- This parameter is required.
-
metricDuration
Measure the Duration of a single canary run, in seconds.Default: avg over 5 minutes
- Parameters:
options-- configuration options for the metric.
-
metricDuration
Measure the Duration of a single canary run, in seconds.Default: avg over 5 minutes
-
metricFailed
Measure the number of failed canary runs over a given time period.Default: sum over 5 minutes
- Parameters:
options-- configuration options for the metric.
-
metricFailed
Measure the number of failed canary runs over a given time period.Default: sum over 5 minutes
-
metricSuccessPercent
Measure the percentage of successful canary runs.Default: avg over 5 minutes
- Parameters:
options-- configuration options for the metric.
-
metricSuccessPercent
Measure the percentage of successful canary runs.Default: avg over 5 minutes
-
getArtifactsBucket
Bucket where data from each canary run is stored. -
getCanaryArn
The canary ARN.- Specified by:
getCanaryArnin interfaceICanary
-
getCanaryId
The canary ID.- Specified by:
getCanaryIdin interfaceICanary
-
getCanaryName
The canary Name.- Specified by:
getCanaryNamein interfaceICanary
-
getCanaryRef
A reference to the canary.- Specified by:
getCanaryRefin interfaceICanaryRef
-
getCanaryState
The state of the canary.For example, 'RUNNING', 'STOPPED', 'NOT STARTED', or 'ERROR'.
-
getConnections
Access the Connections object.Will fail if not a VPC-enabled Canary
- Specified by:
getConnectionsin interfaceIConnectable
-
getRole
Execution role associated with this Canary.
-