Class EcsTarget.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.EcsTarget.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<EcsTarget>
- Enclosing interface:
EcsTarget
@Stability(Stable)
public static final class EcsTarget.Builder
extends Object
implements software.amazon.jsii.Builder<EcsTarget>
A builder for
EcsTarget
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.containerName
(String containerName) Sets the value ofEcsTarget.getContainerName()
containerPort
(Number containerPort) Sets the value ofEcsTarget.getContainerPort()
listener
(ListenerConfig listener) Sets the value ofEcsTarget.getListener()
newTargetGroupId
(String newTargetGroupId) Sets the value ofEcsTarget.getNewTargetGroupId()
Sets the value ofEcsTarget.getProtocol()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
containerName
Sets the value ofEcsTarget.getContainerName()
- Parameters:
containerName
- The name of the container. This parameter is required.- Returns:
this
-
listener
Sets the value ofEcsTarget.getListener()
- Parameters:
listener
- Listener and properties for adding target group to the listener. This parameter is required.- Returns:
this
-
newTargetGroupId
Sets the value ofEcsTarget.getNewTargetGroupId()
- Parameters:
newTargetGroupId
- ID for a target group to be created. This parameter is required.- Returns:
this
-
containerPort
Sets the value ofEcsTarget.getContainerPort()
- Parameters:
containerPort
- The port number of the container. Only applicable when using application/network load balancers.- Returns:
this
-
protocol
Sets the value ofEcsTarget.getProtocol()
- Parameters:
protocol
- The protocol used for the port mapping. Only applicable when using application load balancers.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<EcsTarget>
- Returns:
- a new instance of
EcsTarget
- Throws:
NullPointerException
- if any required attribute was not provided
-