Class NetworkMultipleTargetGroupsFargateService

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:48.759Z") @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(Stable) @NotNull public NetworkTargetGroup getTargetGroup()
      The default target group for the service.
    • getTaskDefinition

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