Interface LoadBalancerTargetOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LoadBalancerTargetOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.414Z")
@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).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 classA builder forLoadBalancerTargetOptionsstatic final classAn 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.BuilderofLoadBalancerTargetOptions
-