Class ApplicationTargetGroupProps.Builder
java.lang.Object
software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroupProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ApplicationTargetGroupProps>
- Enclosing interface:
ApplicationTargetGroupProps
@Stability(Stable)
public static final class ApplicationTargetGroupProps.Builder
extends Object
implements software.amazon.jsii.Builder<ApplicationTargetGroupProps>
A builder for
ApplicationTargetGroupProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.crossZoneEnabled
(Boolean crossZoneEnabled) Sets the value ofBaseTargetGroupProps.getCrossZoneEnabled()
deregistrationDelay
(Duration deregistrationDelay) Sets the value ofBaseTargetGroupProps.getDeregistrationDelay()
enableAnomalyMitigation
(Boolean enableAnomalyMitigation) Sets the value ofApplicationTargetGroupProps.getEnableAnomalyMitigation()
healthCheck
(HealthCheck healthCheck) Sets the value ofBaseTargetGroupProps.getHealthCheck()
ipAddressType
(TargetGroupIpAddressType ipAddressType) Sets the value ofBaseTargetGroupProps.getIpAddressType()
loadBalancingAlgorithmType
(TargetGroupLoadBalancingAlgorithmType loadBalancingAlgorithmType) Sets the value ofApplicationTargetGroupProps.getLoadBalancingAlgorithmType()
Sets the value ofApplicationTargetGroupProps.getPort()
protocol
(ApplicationProtocol protocol) Sets the value ofApplicationTargetGroupProps.getProtocol()
protocolVersion
(ApplicationProtocolVersion protocolVersion) Sets the value ofApplicationTargetGroupProps.getProtocolVersion()
Sets the value ofApplicationTargetGroupProps.getSlowStart()
stickinessCookieDuration
(Duration stickinessCookieDuration) Sets the value ofApplicationTargetGroupProps.getStickinessCookieDuration()
stickinessCookieName
(String stickinessCookieName) Sets the value ofApplicationTargetGroupProps.getStickinessCookieName()
targetGroupName
(String targetGroupName) Sets the value ofBaseTargetGroupProps.getTargetGroupName()
targets
(List<? extends IApplicationLoadBalancerTarget> targets) Sets the value ofApplicationTargetGroupProps.getTargets()
targetType
(TargetType targetType) Sets the value ofBaseTargetGroupProps.getTargetType()
Sets the value ofBaseTargetGroupProps.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
enableAnomalyMitigation
@Stability(Stable) public ApplicationTargetGroupProps.Builder enableAnomalyMitigation(Boolean enableAnomalyMitigation) Sets the value ofApplicationTargetGroupProps.getEnableAnomalyMitigation()
- Parameters:
enableAnomalyMitigation
- Indicates whether anomaly mitigation is enabled. Only available whenloadBalancingAlgorithmType
isTargetGroupLoadBalancingAlgorithmType.WEIGHTED_RANDOM
- Returns:
this
-
loadBalancingAlgorithmType
@Stability(Stable) public ApplicationTargetGroupProps.Builder loadBalancingAlgorithmType(TargetGroupLoadBalancingAlgorithmType loadBalancingAlgorithmType) Sets the value ofApplicationTargetGroupProps.getLoadBalancingAlgorithmType()
- Parameters:
loadBalancingAlgorithmType
- The load balancing algorithm to select targets for routing requests.- Returns:
this
-
port
Sets the value ofApplicationTargetGroupProps.getPort()
- Parameters:
port
- The port on which the target receives traffic. This is not applicable for Lambda targets.- Returns:
this
-
protocol
@Stability(Stable) public ApplicationTargetGroupProps.Builder protocol(ApplicationProtocol protocol) Sets the value ofApplicationTargetGroupProps.getProtocol()
- Parameters:
protocol
- The protocol used for communication with the target. This is not applicable for Lambda targets.- Returns:
this
-
protocolVersion
@Stability(Stable) public ApplicationTargetGroupProps.Builder protocolVersion(ApplicationProtocolVersion protocolVersion) Sets the value ofApplicationTargetGroupProps.getProtocolVersion()
- Parameters:
protocolVersion
- The protocol version to use.- Returns:
this
-
slowStart
Sets the value ofApplicationTargetGroupProps.getSlowStart()
- Parameters:
slowStart
- The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group. The range is 30-900 seconds (15 minutes).- Returns:
this
-
stickinessCookieDuration
@Stability(Stable) public ApplicationTargetGroupProps.Builder stickinessCookieDuration(Duration stickinessCookieDuration) Sets the value ofApplicationTargetGroupProps.getStickinessCookieDuration()
- Parameters:
stickinessCookieDuration
- The stickiness cookie expiration period. Setting this value enables load balancer stickiness.After this period, the cookie is considered stale. The minimum value is 1 second and the maximum value is 7 days (604800 seconds).
- Returns:
this
-
stickinessCookieName
@Stability(Stable) public ApplicationTargetGroupProps.Builder stickinessCookieName(String stickinessCookieName) Sets the value ofApplicationTargetGroupProps.getStickinessCookieName()
- Parameters:
stickinessCookieName
- The name of an application-based stickiness cookie. Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP, and AWSALBTG; they're reserved for use by the load balancer.Note:
stickinessCookieName
parameter depends on the presence ofstickinessCookieDuration
parameter. IfstickinessCookieDuration
is not set,stickinessCookieName
will be omitted.- Returns:
this
-
targets
@Stability(Stable) public ApplicationTargetGroupProps.Builder targets(List<? extends IApplicationLoadBalancerTarget> targets) Sets the value ofApplicationTargetGroupProps.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
-
crossZoneEnabled
@Stability(Stable) public ApplicationTargetGroupProps.Builder crossZoneEnabled(Boolean crossZoneEnabled) Sets the value ofBaseTargetGroupProps.getCrossZoneEnabled()
- Parameters:
crossZoneEnabled
- Indicates whether cross zone load balancing is enabled.- Returns:
this
-
deregistrationDelay
@Stability(Stable) public ApplicationTargetGroupProps.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
-
ipAddressType
@Stability(Stable) public ApplicationTargetGroupProps.Builder ipAddressType(TargetGroupIpAddressType ipAddressType) Sets the value ofBaseTargetGroupProps.getIpAddressType()
- Parameters:
ipAddressType
- The type of IP addresses of the targets registered with the target group.- Returns:
this
-
targetGroupName
@Stability(Stable) public ApplicationTargetGroupProps.Builder targetGroupName(String 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<ApplicationTargetGroupProps>
- Returns:
- a new instance of
ApplicationTargetGroupProps
- Throws:
NullPointerException
- if any required attribute was not provided
-