Interface LoadBalancerTargetOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LoadBalancerTargetOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-10T21:56:50.926Z")
@Stability(Stable)
public interface LoadBalancerTargetOptions
extends software.amazon.jsii.JsiiSerializable
Properties for defining an ECS target.
The port mapping for it must already have been created through addPortMapping().
Example:
Cluster cluster; TaskDefinition taskDefinition; Vpc vpc; Ec2Service service = Ec2Service.Builder.create(this, "Service").cluster(cluster).taskDefinition(taskDefinition).minHealthyPercent(100).build(); LoadBalancer lb = LoadBalancer.Builder.create(this, "LB").vpc(vpc).build(); lb.addListener(LoadBalancerListener.builder().externalPort(80).build()); lb.addTarget(service.loadBalancerTarget(LoadBalancerTargetOptions.builder() .containerName("MyContainer") .containerPort(80) .build()));
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forLoadBalancerTargetOptions
static final class
An implementation forLoadBalancerTargetOptions
-
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getContainerName
The name of the container. -
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
LoadBalancerTargetOptions.Builder
ofLoadBalancerTargetOptions
-