Class NetworkLoadBalancedEc2Service

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

@Generated(value="jsii-pacmak/1.95.0 (build f1ff514)", date="2024-03-26T18:09:23.309Z") @Stability(Stable) public class NetworkLoadBalancedEc2Service extends NetworkLoadBalancedServiceBase
An EC2 service running on an ECS cluster fronted by a network load balancer.

Example:

 Cluster cluster;
 NetworkLoadBalancedEc2Service loadBalancedEcsService = NetworkLoadBalancedEc2Service.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(1024)
         .taskImageOptions(NetworkLoadBalancedTaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("test"))
                 .environment(Map.of(
                         "TEST_ENVIRONMENT_VARIABLE1", "test environment variable 1 value",
                         "TEST_ENVIRONMENT_VARIABLE2", "test environment variable 2 value"))
                 .build())
         .desiredCount(2)
         .build();
 
  • Constructor Details

    • NetworkLoadBalancedEc2Service

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

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

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

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

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

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

    • getService

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

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