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());