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-10-25T14:21:14.589Z")
@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());
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EcsTarget.Builder
builder()
The name of the container.default Number
The port number of the container.Listener and properties for adding target group to the listener.ID for a target group to be created.default Protocol
The protocol used for the port mapping.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getContainerName
The name of the container. -
getListener
Listener and properties for adding target group to the listener. -
getNewTargetGroupId
ID for a target group to be created. -
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
The protocol used for the port mapping.Only applicable when using application load balancers.
Default: Protocol.TCP
-
builder
- Returns:
- a
EcsTarget.Builder
ofEcsTarget
-