Enum DeploymentStrategy

java.lang.Object
java.lang.Enum<DeploymentStrategy>
software.amazon.awscdk.services.ecs.DeploymentStrategy
All Implemented Interfaces:
Serializable, Comparable<DeploymentStrategy>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)", date="2025-08-12T14:44:14.840Z") @Stability(Stable) public enum DeploymentStrategy extends Enum<DeploymentStrategy>
The deployment stratergy to use for ECS controller.

Example:

 import software.amazon.awscdk.services.lambda.*;
 Cluster cluster;
 TaskDefinition taskDefinition;
 Function lambdaHook;
 ApplicationTargetGroup blueTargetGroup;
 ApplicationTargetGroup greenTargetGroup;
 ApplicationListenerRule prodListenerRule;
 FargateService service = FargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .deploymentStrategy(DeploymentStrategy.BLUE_GREEN)
         .build();
 service.addLifecycleHook(DeploymentLifecycleLambdaTarget.Builder.create(lambdaHook, "PreScaleHook")
         .lifecycleStages(List.of(DeploymentLifecycleStage.PRE_SCALE_UP))
         .build());
 IEcsLoadBalancerTarget target = service.loadBalancerTarget(LoadBalancerTargetOptions.builder()
         .containerName("nginx")
         .containerPort(80)
         .protocol(Protocol.TCP)
         .alternateTarget(AlternateTarget.Builder.create("AlternateTarget")
                 .alternateTargetGroup(greenTargetGroup)
                 .productionListener(ListenerRuleConfiguration.applicationListenerRule(prodListenerRule))
                 .build())
         .build());
 target.attachToApplicationTargetGroup(blueTargetGroup);
 
  • Enum Constant Details

    • ROLLING

      @Stability(Stable) public static final DeploymentStrategy ROLLING
      Rolling update deployment.
    • BLUE_GREEN

      @Stability(Stable) public static final DeploymentStrategy BLUE_GREEN
      Blue/green deployment.
  • Method Details

    • values

      public static DeploymentStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DeploymentStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null