Class NetworkTargetGroupProps.Builder
java.lang.Object
software.amazon.awscdk.services.elasticloadbalancingv2.NetworkTargetGroupProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkTargetGroupProps>
- Enclosing interface:
NetworkTargetGroupProps
@Stability(Stable)
public static final class NetworkTargetGroupProps.Builder
extends Object
implements software.amazon.jsii.Builder<NetworkTargetGroupProps>
A builder for
NetworkTargetGroupProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.connectionTermination
(Boolean connectionTermination) Sets the value ofNetworkTargetGroupProps.getConnectionTermination()
deregistrationDelay
(Duration deregistrationDelay) Sets the value ofBaseTargetGroupProps.getDeregistrationDelay()
healthCheck
(HealthCheck healthCheck) Sets the value ofBaseTargetGroupProps.getHealthCheck()
Sets the value ofNetworkTargetGroupProps.getPort()
preserveClientIp
(Boolean preserveClientIp) Sets the value ofNetworkTargetGroupProps.getPreserveClientIp()
Sets the value ofNetworkTargetGroupProps.getProtocol()
proxyProtocolV2
(Boolean proxyProtocolV2) Sets the value ofNetworkTargetGroupProps.getProxyProtocolV2()
targetGroupName
(String targetGroupName) Sets the value ofBaseTargetGroupProps.getTargetGroupName()
targets
(List<? extends INetworkLoadBalancerTarget> targets) Sets the value ofNetworkTargetGroupProps.getTargets()
targetType
(TargetType targetType) Sets the value ofBaseTargetGroupProps.getTargetType()
Sets the value ofBaseTargetGroupProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
port
Sets the value ofNetworkTargetGroupProps.getPort()
- Parameters:
port
- The port on which the target receives traffic. This parameter is required.- Returns:
this
-
connectionTermination
@Stability(Stable) public NetworkTargetGroupProps.Builder connectionTermination(Boolean connectionTermination) Sets the value ofNetworkTargetGroupProps.getConnectionTermination()
- Parameters:
connectionTermination
- Indicates whether the load balancer terminates connections at the end of the deregistration timeout.- Returns:
this
-
preserveClientIp
@Stability(Stable) public NetworkTargetGroupProps.Builder preserveClientIp(Boolean preserveClientIp) Sets the value ofNetworkTargetGroupProps.getPreserveClientIp()
- Parameters:
preserveClientIp
- Indicates whether client IP preservation is enabled.- Returns:
this
-
protocol
Sets the value ofNetworkTargetGroupProps.getProtocol()
- Parameters:
protocol
- Protocol for target group, expects TCP, TLS, UDP, or TCP_UDP.- Returns:
this
-
proxyProtocolV2
Sets the value ofNetworkTargetGroupProps.getProxyProtocolV2()
- Parameters:
proxyProtocolV2
- Indicates whether Proxy Protocol version 2 is enabled.- Returns:
this
-
targets
@Stability(Stable) public NetworkTargetGroupProps.Builder targets(List<? extends INetworkLoadBalancerTarget> targets) Sets the value ofNetworkTargetGroupProps.getTargets()
- Parameters:
targets
- The targets to add to this target group. Can beInstance
,IPAddress
, or any self-registering load balancing target. If you use eitherInstance
orIPAddress
as targets, all target must be of the same type.- Returns:
this
-
deregistrationDelay
@Stability(Stable) public NetworkTargetGroupProps.Builder deregistrationDelay(Duration deregistrationDelay) Sets the value ofBaseTargetGroupProps.getDeregistrationDelay()
- Parameters:
deregistrationDelay
- The amount of time for Elastic Load Balancing to wait before deregistering a target. The range is 0-3600 seconds.- Returns:
this
-
healthCheck
Sets the value ofBaseTargetGroupProps.getHealthCheck()
- Parameters:
healthCheck
- Health check configuration.- Returns:
this
-
targetGroupName
Sets the value ofBaseTargetGroupProps.getTargetGroupName()
- Parameters:
targetGroupName
- The name of the target group. This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.- Returns:
this
-
targetType
Sets the value ofBaseTargetGroupProps.getTargetType()
- Parameters:
targetType
- The type of targets registered to this TargetGroup, either IP or Instance. All targets registered into the group must be of this type. If you register targets to the TargetGroup in the CDK app, the TargetType is determined automatically.- Returns:
this
-
vpc
Sets the value ofBaseTargetGroupProps.getVpc()
- Parameters:
vpc
- The virtual private cloud (VPC). only ifTargetType
isIp
orInstanceId
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NetworkTargetGroupProps>
- Returns:
- a new instance of
NetworkTargetGroupProps
- Throws:
NullPointerException
- if any required attribute was not provided
-