@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.736Z") @Stability(value=Stable) public interface LoadBalancerTargetOptions extends software.amazon.jsii.JsiiSerializable
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).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()));
| Modifier and Type | Interface and Description |
|---|---|
static class |
LoadBalancerTargetOptions.Builder
A builder for
LoadBalancerTargetOptions |
static class |
LoadBalancerTargetOptions.Jsii$Proxy
An implementation for
LoadBalancerTargetOptions |
| Modifier and Type | Method and Description |
|---|---|
static LoadBalancerTargetOptions.Builder |
builder() |
String |
getContainerName()
The name of the container.
|
default Number |
getContainerPort()
The port number of the container.
|
default Protocol |
getProtocol()
The protocol used for the port mapping.
|
@Stability(value=Stable) @NotNull String getContainerName()
@Stability(value=Stable) @Nullable default Number getContainerPort()
Only applicable when using application/network load balancers.
Default: - Container port of the first added port mapping.
@Stability(value=Stable) @Nullable default Protocol getProtocol()
Only applicable when using application load balancers.
Default: Protocol.TCP
@Stability(value=Stable) static LoadBalancerTargetOptions.Builder builder()
LoadBalancerTargetOptions.Builder of LoadBalancerTargetOptionsCopyright © 2022. All rights reserved.