Class ApplicationMultipleTargetGroupsEc2Service

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase
software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsEc2Service
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-11T23:26:32.954Z") @Stability(Stable) public class ApplicationMultipleTargetGroupsEc2Service extends ApplicationMultipleTargetGroupsServiceBase
An EC2 service running on an ECS cluster fronted by an application load balancer.

Example:

 // One application load balancer with one listener and two target groups.
 Cluster cluster;
 ApplicationMultipleTargetGroupsEc2Service loadBalancedEc2Service = ApplicationMultipleTargetGroupsEc2Service.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(256)
         .taskImageOptions(ApplicationLoadBalancedTaskImageProps.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .build())
         .targetGroups(List.of(ApplicationTargetProps.builder()
                 .containerPort(80)
                 .build(), ApplicationTargetProps.builder()
                 .containerPort(90)
                 .pathPattern("a/b/c")
                 .priority(10)
                 .build()))
         .build();
 
  • Constructor Details

    • ApplicationMultipleTargetGroupsEc2Service

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

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

      @Stability(Stable) public ApplicationMultipleTargetGroupsEc2Service(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ApplicationMultipleTargetGroupsEc2ServiceProps props)
      Constructs a new instance of the ApplicationMultipleTargetGroupsEc2Service class.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • ApplicationMultipleTargetGroupsEc2Service

      @Stability(Stable) public ApplicationMultipleTargetGroupsEc2Service(@NotNull software.constructs.Construct scope, @NotNull String id)
      Constructs a new instance of the ApplicationMultipleTargetGroupsEc2Service class.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • getService

      @Stability(Stable) @NotNull public Ec2Service getService()
      The EC2 service in this construct.
    • getTargetGroup

      @Stability(Deprecated) @Deprecated @NotNull public ApplicationTargetGroup getTargetGroup()
      Deprecated.
      • Use targetGroups instead.
      (deprecated) The default target group for the service.

    • getTaskDefinition

      @Stability(Stable) @NotNull public Ec2TaskDefinition getTaskDefinition()
      The EC2 Task Definition in this construct.