Class ListenerRuleConfiguration

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.ListenerRuleConfiguration
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-09T14:39:10.383Z") @Stability(Stable) public abstract class ListenerRuleConfiguration extends software.amazon.jsii.JsiiObject
Represents a listener configuration for advanced load balancer settings.

Example:

 Cluster cluster;
 TaskDefinition taskDefinition;
 ApplicationTargetGroup blueTargetGroup;
 ApplicationTargetGroup greenTargetGroup;
 ApplicationListenerRule prodListenerRule;
 FargateService service = FargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .deploymentStrategy(DeploymentStrategy.LINEAR)
         .linearConfiguration(TrafficShiftConfig.builder()
                 .stepPercent(10)
                 .stepBakeTime(Duration.minutes(5))
                 .build())
         .build();
 IEcsLoadBalancerTarget target = service.loadBalancerTarget(LoadBalancerTargetOptions.builder()
         .containerName("web")
         .containerPort(80)
         .alternateTarget(AlternateTarget.Builder.create("AlternateTarget")
                 .alternateTargetGroup(greenTargetGroup)
                 .productionListener(ListenerRuleConfiguration.applicationListenerRule(prodListenerRule))
                 .build())
         .build());
 target.attachToApplicationTargetGroup(blueTargetGroup);
 
  • Constructor Details

    • ListenerRuleConfiguration

      protected ListenerRuleConfiguration(software.amazon.jsii.JsiiObjectRef objRef)
    • ListenerRuleConfiguration

      protected ListenerRuleConfiguration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ListenerRuleConfiguration

      @Stability(Stable) protected ListenerRuleConfiguration()
  • Method Details

    • applicationListenerRule

      @Stability(Stable) @NotNull public static ListenerRuleConfiguration applicationListenerRule(@NotNull ApplicationListenerRule rule)
      Use an Application Load Balancer listener rule.

      Parameters:
      rule - This parameter is required.
    • networkListener

      @Stability(Stable) @NotNull public static ListenerRuleConfiguration networkListener(@NotNull NetworkListener listener)
      Use a Network Load Balancer listener.

      Parameters:
      listener - This parameter is required.