Interface EcsTarget

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
EcsTarget.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-09-24T10:56:31.416Z") @Stability(Stable) public interface EcsTarget extends software.amazon.jsii.JsiiSerializable
Example:

 Cluster cluster;
 TaskDefinition taskDefinition;
 Vpc vpc;
 FargateService service = FargateService.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).build();
 ApplicationLoadBalancer lb = ApplicationLoadBalancer.Builder.create(this, "LB").vpc(vpc).internetFacing(true).build();
 ApplicationListener listener = lb.addListener("Listener", BaseApplicationListenerProps.builder().port(80).build());
 service.registerLoadBalancerTargets(EcsTarget.builder()
         .containerName("web")
         .containerPort(80)
         .newTargetGroupId("ECS")
         .listener(ListenerConfig.applicationListener(listener, AddApplicationTargetsProps.builder()
                 .protocol(ApplicationProtocol.HTTPS)
                 .build()))
         .build());
 
  • Method Details

    • getContainerName

      @Stability(Stable) @NotNull String getContainerName()
      The name of the container.
    • getListener

      @Stability(Stable) @NotNull ListenerConfig getListener()
      Listener and properties for adding target group to the listener.
    • getNewTargetGroupId

      @Stability(Stable) @NotNull String getNewTargetGroupId()
      ID for a target group to be created.
    • getContainerPort

      @Stability(Stable) @Nullable default Number getContainerPort()
      The port number of the container.

      Only applicable when using application/network load balancers.

      Default: - Container port of the first added port mapping.

    • getProtocol

      @Stability(Stable) @Nullable default Protocol getProtocol()
      The protocol used for the port mapping.

      Only applicable when using application load balancers.

      Default: Protocol.TCP

    • builder

      @Stability(Stable) static EcsTarget.Builder builder()
      Returns:
      a EcsTarget.Builder of EcsTarget