Interface DeploymentAlarmConfig
- All Superinterfaces:
DeploymentAlarmOptions
,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
DeploymentAlarmConfig.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-04T09:06:21.799Z")
@Stability(Stable)
public interface DeploymentAlarmConfig
extends software.amazon.jsii.JsiiSerializable, DeploymentAlarmOptions
Configuration for deployment alarms.
Example:
import software.amazon.awscdk.services.cloudwatch.*; Cluster cluster; TaskDefinition taskDefinition; Alarm elbAlarm; FargateService service = FargateService.Builder.create(this, "Service") .cluster(cluster) .taskDefinition(taskDefinition) .deploymentAlarms(DeploymentAlarmConfig.builder() .alarmNames(List.of(elbAlarm.getAlarmName())) .behavior(AlarmBehavior.ROLLBACK_ON_ALARM) .build()) .build(); // Defining a deployment alarm after the service has been created String cpuAlarmName = "MyCpuMetricAlarm"; Alarm.Builder.create(this, "CPUAlarm") .alarmName(cpuAlarmName) .metric(service.metricCpuUtilization()) .evaluationPeriods(2) .threshold(80) .build(); service.enableDeploymentAlarms(List.of(cpuAlarmName), DeploymentAlarmOptions.builder() .behavior(AlarmBehavior.FAIL_ON_ALARM) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forDeploymentAlarmConfig
static final class
An implementation forDeploymentAlarmConfig
-
Method Summary
Methods inherited from interface software.amazon.awscdk.services.ecs.DeploymentAlarmOptions
getBehavior
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAlarmNames
List of alarm names to monitor during deployments. -
builder
- Returns:
- a
DeploymentAlarmConfig.Builder
ofDeploymentAlarmConfig
-