Class NetworkMultipleTargetGroupsFargateService

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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:06.731Z") @Stability(Stable) public class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTargetGroupsServiceBase
A Fargate service running on an ECS cluster fronted by a network load balancer.

Example:

 // Two network load balancers, each with their own listener and target group.
 Cluster cluster;
 NetworkMultipleTargetGroupsFargateService loadBalancedFargateService = NetworkMultipleTargetGroupsFargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(512)
         .taskImageOptions(NetworkLoadBalancedTaskImageProps.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .build())
         .loadBalancers(List.of(NetworkLoadBalancerProps.builder()
                 .name("lb1")
                 .listeners(List.of(NetworkListenerProps.builder()
                         .name("listener1")
                         .build()))
                 .build(), NetworkLoadBalancerProps.builder()
                 .name("lb2")
                 .listeners(List.of(NetworkListenerProps.builder()
                         .name("listener2")
                         .build()))
                 .build()))
         .targetGroups(List.of(NetworkTargetProps.builder()
                 .containerPort(80)
                 .listener("listener1")
                 .build(), NetworkTargetProps.builder()
                 .containerPort(90)
                 .listener("listener2")
                 .build()))
         .build();
 
  • Constructor Details

    • NetworkMultipleTargetGroupsFargateService

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

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

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

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

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

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

    • getAssignPublicIp

      @Stability(Stable) @NotNull public Boolean getAssignPublicIp()
      Determines whether the service will be assigned a public IP address.
    • getService

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

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

    • getTaskDefinition

      @Stability(Stable) @NotNull public FargateTaskDefinition getTaskDefinition()
      The Fargate task definition in this construct.