public static final class ApplicationTargetGroup.Builder
extends java.lang.Object
ApplicationTargetGroup
.Modifier and Type | Method and Description |
---|---|
ApplicationTargetGroup |
build() |
static ApplicationTargetGroup.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
ApplicationTargetGroup.Builder |
deregistrationDelay(Duration deregistrationDelay)
The amount of time for Elastic Load Balancing to wait before deregistering a target.
|
ApplicationTargetGroup.Builder |
healthCheck(HealthCheck healthCheck)
Health check configuration.
|
ApplicationTargetGroup.Builder |
loadBalancingAlgorithmType(TargetGroupLoadBalancingAlgorithmType loadBalancingAlgorithmType)
The load balancing algorithm to select targets for routing requests.
|
ApplicationTargetGroup.Builder |
port(java.lang.Number port)
The port on which the listener listens for requests.
|
ApplicationTargetGroup.Builder |
protocol(ApplicationProtocol protocol)
The protocol to use.
|
ApplicationTargetGroup.Builder |
protocolVersion(ApplicationProtocolVersion protocolVersion)
The protocol version to use.
|
ApplicationTargetGroup.Builder |
slowStart(Duration 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.
|
ApplicationTargetGroup.Builder |
stickinessCookieDuration(Duration stickinessCookieDuration)
The stickiness cookie expiration period.
|
ApplicationTargetGroup.Builder |
stickinessCookieName(java.lang.String stickinessCookieName)
The name of an application-based stickiness cookie.
|
ApplicationTargetGroup.Builder |
targetGroupName(java.lang.String targetGroupName)
The name of the target group.
|
ApplicationTargetGroup.Builder |
targets(java.util.List<? extends IApplicationLoadBalancerTarget> targets)
The targets to add to this target group.
|
ApplicationTargetGroup.Builder |
targetType(TargetType targetType)
The type of targets registered to this TargetGroup, either IP or Instance.
|
ApplicationTargetGroup.Builder |
vpc(IVpc vpc)
The virtual private cloud (VPC).
|
public static ApplicationTargetGroup.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.ApplicationTargetGroup.Builder
.public ApplicationTargetGroup.Builder deregistrationDelay(Duration deregistrationDelay)
The range is 0-3600 seconds.
Default: 300
deregistrationDelay
- The amount of time for Elastic Load Balancing to wait before deregistering a target. This parameter is required.this
public ApplicationTargetGroup.Builder healthCheck(HealthCheck healthCheck)
Default: - The default value for each property in this configuration varies depending on the target.
healthCheck
- Health check configuration. This parameter is required.this
public ApplicationTargetGroup.Builder targetGroupName(java.lang.String targetGroupName)
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.
Default: - Automatically generated.
targetGroupName
- The name of the target group. This parameter is required.this
public ApplicationTargetGroup.Builder targetType(TargetType targetType)
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.
Default: - Determined automatically.
targetType
- The type of targets registered to this TargetGroup, either IP or Instance. This parameter is required.this
public ApplicationTargetGroup.Builder vpc(IVpc vpc)
only if TargetType
is Ip
or InstanceId
Default: - undefined
vpc
- The virtual private cloud (VPC). This parameter is required.this
public ApplicationTargetGroup.Builder loadBalancingAlgorithmType(TargetGroupLoadBalancingAlgorithmType loadBalancingAlgorithmType)
Default: TargetGroupLoadBalancingAlgorithmType.ROUND_ROBIN
loadBalancingAlgorithmType
- The load balancing algorithm to select targets for routing requests. This parameter is required.this
public ApplicationTargetGroup.Builder port(java.lang.Number port)
Default: - Determined from protocol if known, optional for Lambda targets.
port
- The port on which the listener listens for requests. This parameter is required.this
public ApplicationTargetGroup.Builder protocol(ApplicationProtocol protocol)
Default: - Determined from port if known, optional for Lambda targets.
protocol
- The protocol to use. This parameter is required.this
public ApplicationTargetGroup.Builder protocolVersion(ApplicationProtocolVersion protocolVersion)
Default: ApplicationProtocolVersion.HTTP1
protocolVersion
- The protocol version to use. This parameter is required.this
public ApplicationTargetGroup.Builder slowStart(Duration slowStart)
The range is 30-900 seconds (15 minutes).
Default: 0
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. This parameter is required.this
public ApplicationTargetGroup.Builder stickinessCookieDuration(Duration stickinessCookieDuration)
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).
Default: Duration.days(1)
stickinessCookieDuration
- The stickiness cookie expiration period. This parameter is required.this
public ApplicationTargetGroup.Builder stickinessCookieName(java.lang.String stickinessCookieName)
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 of stickinessCookieDuration
parameter.
If stickinessCookieDuration
is not set, stickinessCookieName
will be omitted.
Default: - If `stickinessCookieDuration` is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.
stickinessCookieName
- The name of an application-based stickiness cookie. This parameter is required.this
public ApplicationTargetGroup.Builder targets(java.util.List<? extends IApplicationLoadBalancerTarget> targets)
Can be Instance
, IPAddress
, or any self-registering load balancing
target. If you use either Instance
or IPAddress
as targets, all
target must be of the same type.
Default: - No targets.
targets
- The targets to add to this target group. This parameter is required.this
public ApplicationTargetGroup build()