com.amazonaws.services.elasticloadbalancingv2.model.CreateTargetGroupRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-elasticloadbalancingv2 Show documentation
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.elasticloadbalancingv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateTargetGroupRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* 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.
*
*/
private String name;
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*/
private String protocol;
/**
*
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*
*/
private Integer port;
/**
*
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not
* apply.
*
*/
private String vpcId;
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*/
private String healthCheckProtocol;
/**
*
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
*
*/
private String healthCheckPort;
/**
*
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
, health
* checks are always enabled and cannot be disabled.
*
*/
private Boolean healthCheckEnabled;
/**
*
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The default is
* /.
*
*/
private String healthCheckPath;
/**
*
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and HTTPS
* health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30 seconds. If
* the target type is instance
or ip
, the default is 30 seconds. If the target type is
* lambda
, the default is 35 seconds.
*
*/
private Integer healthCheckIntervalSeconds;
/**
*
* The amount of time, in seconds, during which no response from a target means a failed health check. For target
* groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a protocol of TCP or
* TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and HTTPS health checks. If the
* target type is lambda
, the default is 30 seconds.
*
*/
private Integer healthCheckTimeoutSeconds;
/**
*
* The number of consecutive health checks successes required before considering an unhealthy target healthy. For
* target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of TCP or
* TLS, the default is 3. If the target type is lambda
, the default is 5.
*
*/
private Integer healthyThresholdCount;
/**
*
* The number of consecutive health check failures required before considering a target unhealthy. For target groups
* with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or TLS, this value
* must be the same as the healthy threshold count. If the target type is lambda
, the default is 2.
*
*/
private Integer unhealthyThresholdCount;
/**
*
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*
*/
private Matcher matcher;
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*/
private String targetType;
/**
*
* 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.
*
*
* @param name
* 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.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* 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.
*
*
* @return 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.
*/
public String getName() {
return this.name;
}
/**
*
* 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.
*
*
* @param name
* 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*
* @param protocol
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported
* protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or
* TCP_UDP. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda
* function, this parameter does not apply.
* @see ProtocolEnum
*/
public void setProtocol(String protocol) {
this.protocol = protocol;
}
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*
* @return The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported
* protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or
* TCP_UDP. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda
* function, this parameter does not apply.
* @see ProtocolEnum
*/
public String getProtocol() {
return this.protocol;
}
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*
* @param protocol
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported
* protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or
* TCP_UDP. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda
* function, this parameter does not apply.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolEnum
*/
public CreateTargetGroupRequest withProtocol(String protocol) {
setProtocol(protocol);
return this;
}
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*
* @param protocol
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported
* protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or
* TCP_UDP. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda
* function, this parameter does not apply.
* @see ProtocolEnum
*/
public void setProtocol(ProtocolEnum protocol) {
withProtocol(protocol);
}
/**
*
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported protocols
* are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or TCP_UDP. A TCP_UDP
* listener must be associated with a TCP_UDP target group. If the target is a Lambda function, this parameter does
* not apply.
*
*
* @param protocol
* The protocol to use for routing traffic to the targets. For Application Load Balancers, the supported
* protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocols are TCP, TLS, UDP, or
* TCP_UDP. A TCP_UDP listener must be associated with a TCP_UDP target group. If the target is a Lambda
* function, this parameter does not apply.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolEnum
*/
public CreateTargetGroupRequest withProtocol(ProtocolEnum protocol) {
this.protocol = protocol.toString();
return this;
}
/**
*
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*
*
* @param port
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*/
public void setPort(Integer port) {
this.port = port;
}
/**
*
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*
*
* @return The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*/
public Integer getPort() {
return this.port;
}
/**
*
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
*
*
* @param port
* The port on which the targets receive traffic. This port is used unless you specify a port override when
* registering the target. If the target is a Lambda function, this parameter does not apply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withPort(Integer port) {
setPort(port);
return this;
}
/**
*
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not
* apply.
*
*
* @param vpcId
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does
* not apply.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not
* apply.
*
*
* @return The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter
* does not apply.
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does not
* apply.
*
*
* @param vpcId
* The identifier of the virtual private cloud (VPC). If the target is a Lambda function, this parameter does
* not apply.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*
* @param healthCheckProtocol
* The protocol the load balancer uses when performing health checks on targets. For Application Load
* Balancers, the default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is
* supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The
* TLS, UDP, and TCP_UDP protocols are not supported for health checks.
* @see ProtocolEnum
*/
public void setHealthCheckProtocol(String healthCheckProtocol) {
this.healthCheckProtocol = healthCheckProtocol;
}
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*
* @return The protocol the load balancer uses when performing health checks on targets. For Application Load
* Balancers, the default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is
* supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The
* TLS, UDP, and TCP_UDP protocols are not supported for health checks.
* @see ProtocolEnum
*/
public String getHealthCheckProtocol() {
return this.healthCheckProtocol;
}
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*
* @param healthCheckProtocol
* The protocol the load balancer uses when performing health checks on targets. For Application Load
* Balancers, the default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is
* supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The
* TLS, UDP, and TCP_UDP protocols are not supported for health checks.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolEnum
*/
public CreateTargetGroupRequest withHealthCheckProtocol(String healthCheckProtocol) {
setHealthCheckProtocol(healthCheckProtocol);
return this;
}
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*
* @param healthCheckProtocol
* The protocol the load balancer uses when performing health checks on targets. For Application Load
* Balancers, the default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is
* supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The
* TLS, UDP, and TCP_UDP protocols are not supported for health checks.
* @see ProtocolEnum
*/
public void setHealthCheckProtocol(ProtocolEnum healthCheckProtocol) {
withHealthCheckProtocol(healthCheckProtocol);
}
/**
*
* The protocol the load balancer uses when performing health checks on targets. For Application Load Balancers, the
* default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is supported for health checks
* only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols are
* not supported for health checks.
*
*
* @param healthCheckProtocol
* The protocol the load balancer uses when performing health checks on targets. For Application Load
* Balancers, the default is HTTP. For Network Load Balancers, the default is TCP. The TCP protocol is
* supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP. The
* TLS, UDP, and TCP_UDP protocols are not supported for health checks.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ProtocolEnum
*/
public CreateTargetGroupRequest withHealthCheckProtocol(ProtocolEnum healthCheckProtocol) {
this.healthCheckProtocol = healthCheckProtocol.toString();
return this;
}
/**
*
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
*
*
* @param healthCheckPort
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
*/
public void setHealthCheckPort(String healthCheckPort) {
this.healthCheckPort = healthCheckPort;
}
/**
*
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
*
*
* @return The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load
* balancer.
*/
public String getHealthCheckPort() {
return this.healthCheckPort;
}
/**
*
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
*
*
* @param healthCheckPort
* The port the load balancer uses when performing health checks on targets. The default is
* traffic-port
, which is the port on which each target receives traffic from the load balancer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthCheckPort(String healthCheckPort) {
setHealthCheckPort(healthCheckPort);
return this;
}
/**
*
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
, health
* checks are always enabled and cannot be disabled.
*
*
* @param healthCheckEnabled
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
,
* health checks are always enabled and cannot be disabled.
*/
public void setHealthCheckEnabled(Boolean healthCheckEnabled) {
this.healthCheckEnabled = healthCheckEnabled;
}
/**
*
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
, health
* checks are always enabled and cannot be disabled.
*
*
* @return Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
,
* health checks are always enabled and cannot be disabled.
*/
public Boolean getHealthCheckEnabled() {
return this.healthCheckEnabled;
}
/**
*
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
, health
* checks are always enabled and cannot be disabled.
*
*
* @param healthCheckEnabled
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
,
* health checks are always enabled and cannot be disabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthCheckEnabled(Boolean healthCheckEnabled) {
setHealthCheckEnabled(healthCheckEnabled);
return this;
}
/**
*
* Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
, health
* checks are always enabled and cannot be disabled.
*
*
* @return Indicates whether health checks are enabled. If the target type is lambda
, health checks are
* disabled by default but can be enabled. If the target type is instance
or ip
,
* health checks are always enabled and cannot be disabled.
*/
public Boolean isHealthCheckEnabled() {
return this.healthCheckEnabled;
}
/**
*
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The default is
* /.
*
*
* @param healthCheckPath
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The
* default is /.
*/
public void setHealthCheckPath(String healthCheckPath) {
this.healthCheckPath = healthCheckPath;
}
/**
*
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The default is
* /.
*
*
* @return [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The
* default is /.
*/
public String getHealthCheckPath() {
return this.healthCheckPath;
}
/**
*
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The default is
* /.
*
*
* @param healthCheckPath
* [HTTP/HTTPS health checks] The ping path that is the destination on the targets for health checks. The
* default is /.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthCheckPath(String healthCheckPath) {
setHealthCheckPath(healthCheckPath);
return this;
}
/**
*
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and HTTPS
* health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30 seconds. If
* the target type is instance
or ip
, the default is 30 seconds. If the target type is
* lambda
, the default is 35 seconds.
*
*
* @param healthCheckIntervalSeconds
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and
* HTTPS health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30
* seconds. If the target type is instance
or ip
, the default is 30 seconds. If the
* target type is lambda
, the default is 35 seconds.
*/
public void setHealthCheckIntervalSeconds(Integer healthCheckIntervalSeconds) {
this.healthCheckIntervalSeconds = healthCheckIntervalSeconds;
}
/**
*
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and HTTPS
* health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30 seconds. If
* the target type is instance
or ip
, the default is 30 seconds. If the target type is
* lambda
, the default is 35 seconds.
*
*
* @return The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and
* HTTPS health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and
* 30 seconds. If the target type is instance
or ip
, the default is 30 seconds. If
* the target type is lambda
, the default is 35 seconds.
*/
public Integer getHealthCheckIntervalSeconds() {
return this.healthCheckIntervalSeconds;
}
/**
*
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and HTTPS
* health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30 seconds. If
* the target type is instance
or ip
, the default is 30 seconds. If the target type is
* lambda
, the default is 35 seconds.
*
*
* @param healthCheckIntervalSeconds
* The approximate amount of time, in seconds, between health checks of an individual target. For HTTP and
* HTTPS health checks, the range is 5–300 seconds. For TCP health checks, the supported values are 10 and 30
* seconds. If the target type is instance
or ip
, the default is 30 seconds. If the
* target type is lambda
, the default is 35 seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthCheckIntervalSeconds(Integer healthCheckIntervalSeconds) {
setHealthCheckIntervalSeconds(healthCheckIntervalSeconds);
return this;
}
/**
*
* The amount of time, in seconds, during which no response from a target means a failed health check. For target
* groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a protocol of TCP or
* TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and HTTPS health checks. If the
* target type is lambda
, the default is 30 seconds.
*
*
* @param healthCheckTimeoutSeconds
* The amount of time, in seconds, during which no response from a target means a failed health check. For
* target groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a
* protocol of TCP or TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and
* HTTPS health checks. If the target type is lambda
, the default is 30 seconds.
*/
public void setHealthCheckTimeoutSeconds(Integer healthCheckTimeoutSeconds) {
this.healthCheckTimeoutSeconds = healthCheckTimeoutSeconds;
}
/**
*
* The amount of time, in seconds, during which no response from a target means a failed health check. For target
* groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a protocol of TCP or
* TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and HTTPS health checks. If the
* target type is lambda
, the default is 30 seconds.
*
*
* @return The amount of time, in seconds, during which no response from a target means a failed health check. For
* target groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a
* protocol of TCP or TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and
* HTTPS health checks. If the target type is lambda
, the default is 30 seconds.
*/
public Integer getHealthCheckTimeoutSeconds() {
return this.healthCheckTimeoutSeconds;
}
/**
*
* The amount of time, in seconds, during which no response from a target means a failed health check. For target
* groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a protocol of TCP or
* TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and HTTPS health checks. If the
* target type is lambda
, the default is 30 seconds.
*
*
* @param healthCheckTimeoutSeconds
* The amount of time, in seconds, during which no response from a target means a failed health check. For
* target groups with a protocol of HTTP or HTTPS, the default is 5 seconds. For target groups with a
* protocol of TCP or TLS, this value must be 6 seconds for HTTP health checks and 10 seconds for TCP and
* HTTPS health checks. If the target type is lambda
, the default is 30 seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthCheckTimeoutSeconds(Integer healthCheckTimeoutSeconds) {
setHealthCheckTimeoutSeconds(healthCheckTimeoutSeconds);
return this;
}
/**
*
* The number of consecutive health checks successes required before considering an unhealthy target healthy. For
* target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of TCP or
* TLS, the default is 3. If the target type is lambda
, the default is 5.
*
*
* @param healthyThresholdCount
* The number of consecutive health checks successes required before considering an unhealthy target healthy.
* For target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of
* TCP or TLS, the default is 3. If the target type is lambda
, the default is 5.
*/
public void setHealthyThresholdCount(Integer healthyThresholdCount) {
this.healthyThresholdCount = healthyThresholdCount;
}
/**
*
* The number of consecutive health checks successes required before considering an unhealthy target healthy. For
* target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of TCP or
* TLS, the default is 3. If the target type is lambda
, the default is 5.
*
*
* @return The number of consecutive health checks successes required before considering an unhealthy target
* healthy. For target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a
* protocol of TCP or TLS, the default is 3. If the target type is lambda
, the default is 5.
*/
public Integer getHealthyThresholdCount() {
return this.healthyThresholdCount;
}
/**
*
* The number of consecutive health checks successes required before considering an unhealthy target healthy. For
* target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of TCP or
* TLS, the default is 3. If the target type is lambda
, the default is 5.
*
*
* @param healthyThresholdCount
* The number of consecutive health checks successes required before considering an unhealthy target healthy.
* For target groups with a protocol of HTTP or HTTPS, the default is 5. For target groups with a protocol of
* TCP or TLS, the default is 3. If the target type is lambda
, the default is 5.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withHealthyThresholdCount(Integer healthyThresholdCount) {
setHealthyThresholdCount(healthyThresholdCount);
return this;
}
/**
*
* The number of consecutive health check failures required before considering a target unhealthy. For target groups
* with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or TLS, this value
* must be the same as the healthy threshold count. If the target type is lambda
, the default is 2.
*
*
* @param unhealthyThresholdCount
* The number of consecutive health check failures required before considering a target unhealthy. For target
* groups with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or
* TLS, this value must be the same as the healthy threshold count. If the target type is lambda
* , the default is 2.
*/
public void setUnhealthyThresholdCount(Integer unhealthyThresholdCount) {
this.unhealthyThresholdCount = unhealthyThresholdCount;
}
/**
*
* The number of consecutive health check failures required before considering a target unhealthy. For target groups
* with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or TLS, this value
* must be the same as the healthy threshold count. If the target type is lambda
, the default is 2.
*
*
* @return The number of consecutive health check failures required before considering a target unhealthy. For
* target groups with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of
* TCP or TLS, this value must be the same as the healthy threshold count. If the target type is
* lambda
, the default is 2.
*/
public Integer getUnhealthyThresholdCount() {
return this.unhealthyThresholdCount;
}
/**
*
* The number of consecutive health check failures required before considering a target unhealthy. For target groups
* with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or TLS, this value
* must be the same as the healthy threshold count. If the target type is lambda
, the default is 2.
*
*
* @param unhealthyThresholdCount
* The number of consecutive health check failures required before considering a target unhealthy. For target
* groups with a protocol of HTTP or HTTPS, the default is 2. For target groups with a protocol of TCP or
* TLS, this value must be the same as the healthy threshold count. If the target type is lambda
* , the default is 2.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withUnhealthyThresholdCount(Integer unhealthyThresholdCount) {
setUnhealthyThresholdCount(unhealthyThresholdCount);
return this;
}
/**
*
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*
*
* @param matcher
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*/
public void setMatcher(Matcher matcher) {
this.matcher = matcher;
}
/**
*
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*
*
* @return [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*/
public Matcher getMatcher() {
return this.matcher;
}
/**
*
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
*
*
* @param matcher
* [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful response from a target.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTargetGroupRequest withMatcher(Matcher matcher) {
setMatcher(matcher);
return this;
}
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*
* @param targetType
* The type of target that you must specify when registering targets with this target group. You can't
* specify targets for a target group using more than one target type.
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target
* group protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of
* the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
* @see TargetTypeEnum
*/
public void setTargetType(String targetType) {
this.targetType = targetType;
}
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*
* @return The type of target that you must specify when registering targets with this target group. You can't
* specify targets for a target group using more than one target type.
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target
* group protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of
* the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP
* addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
* @see TargetTypeEnum
*/
public String getTargetType() {
return this.targetType;
}
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*
* @param targetType
* The type of target that you must specify when registering targets with this target group. You can't
* specify targets for a target group using more than one target type.
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target
* group protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of
* the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetTypeEnum
*/
public CreateTargetGroupRequest withTargetType(String targetType) {
setTargetType(targetType);
return this;
}
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*
* @param targetType
* The type of target that you must specify when registering targets with this target group. You can't
* specify targets for a target group using more than one target type.
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target
* group protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of
* the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
* @see TargetTypeEnum
*/
public void setTargetType(TargetTypeEnum targetType) {
withTargetType(targetType);
}
/**
*
* The type of target that you must specify when registering targets with this target group. You can't specify
* targets for a target group using more than one target type.
*
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target group
* protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of the
* virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
*
*
* @param targetType
* The type of target that you must specify when registering targets with this target group. You can't
* specify targets for a target group using more than one target type.
*
* -
*
* instance
- Targets are specified by instance ID. This is the default value. If the target
* group protocol is UDP or TCP_UDP, the target type must be instance
.
*
*
* -
*
* ip
- Targets are specified by IP address. You can specify IP addresses from the subnets of
* the virtual private cloud (VPC) for the target group, the RFC 1918 range (10.0.0.0/8, 172.16.0.0/12, and
* 192.168.0.0/16), and the RFC 6598 range (100.64.0.0/10). You can't specify publicly routable IP addresses.
*
*
* -
*
* lambda
- The target groups contains a single Lambda function.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see TargetTypeEnum
*/
public CreateTargetGroupRequest withTargetType(TargetTypeEnum targetType) {
this.targetType = targetType.toString();
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getProtocol() != null)
sb.append("Protocol: ").append(getProtocol()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getHealthCheckProtocol() != null)
sb.append("HealthCheckProtocol: ").append(getHealthCheckProtocol()).append(",");
if (getHealthCheckPort() != null)
sb.append("HealthCheckPort: ").append(getHealthCheckPort()).append(",");
if (getHealthCheckEnabled() != null)
sb.append("HealthCheckEnabled: ").append(getHealthCheckEnabled()).append(",");
if (getHealthCheckPath() != null)
sb.append("HealthCheckPath: ").append(getHealthCheckPath()).append(",");
if (getHealthCheckIntervalSeconds() != null)
sb.append("HealthCheckIntervalSeconds: ").append(getHealthCheckIntervalSeconds()).append(",");
if (getHealthCheckTimeoutSeconds() != null)
sb.append("HealthCheckTimeoutSeconds: ").append(getHealthCheckTimeoutSeconds()).append(",");
if (getHealthyThresholdCount() != null)
sb.append("HealthyThresholdCount: ").append(getHealthyThresholdCount()).append(",");
if (getUnhealthyThresholdCount() != null)
sb.append("UnhealthyThresholdCount: ").append(getUnhealthyThresholdCount()).append(",");
if (getMatcher() != null)
sb.append("Matcher: ").append(getMatcher()).append(",");
if (getTargetType() != null)
sb.append("TargetType: ").append(getTargetType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateTargetGroupRequest == false)
return false;
CreateTargetGroupRequest other = (CreateTargetGroupRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getProtocol() == null ^ this.getProtocol() == null)
return false;
if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
return false;
if (other.getHealthCheckProtocol() == null ^ this.getHealthCheckProtocol() == null)
return false;
if (other.getHealthCheckProtocol() != null && other.getHealthCheckProtocol().equals(this.getHealthCheckProtocol()) == false)
return false;
if (other.getHealthCheckPort() == null ^ this.getHealthCheckPort() == null)
return false;
if (other.getHealthCheckPort() != null && other.getHealthCheckPort().equals(this.getHealthCheckPort()) == false)
return false;
if (other.getHealthCheckEnabled() == null ^ this.getHealthCheckEnabled() == null)
return false;
if (other.getHealthCheckEnabled() != null && other.getHealthCheckEnabled().equals(this.getHealthCheckEnabled()) == false)
return false;
if (other.getHealthCheckPath() == null ^ this.getHealthCheckPath() == null)
return false;
if (other.getHealthCheckPath() != null && other.getHealthCheckPath().equals(this.getHealthCheckPath()) == false)
return false;
if (other.getHealthCheckIntervalSeconds() == null ^ this.getHealthCheckIntervalSeconds() == null)
return false;
if (other.getHealthCheckIntervalSeconds() != null && other.getHealthCheckIntervalSeconds().equals(this.getHealthCheckIntervalSeconds()) == false)
return false;
if (other.getHealthCheckTimeoutSeconds() == null ^ this.getHealthCheckTimeoutSeconds() == null)
return false;
if (other.getHealthCheckTimeoutSeconds() != null && other.getHealthCheckTimeoutSeconds().equals(this.getHealthCheckTimeoutSeconds()) == false)
return false;
if (other.getHealthyThresholdCount() == null ^ this.getHealthyThresholdCount() == null)
return false;
if (other.getHealthyThresholdCount() != null && other.getHealthyThresholdCount().equals(this.getHealthyThresholdCount()) == false)
return false;
if (other.getUnhealthyThresholdCount() == null ^ this.getUnhealthyThresholdCount() == null)
return false;
if (other.getUnhealthyThresholdCount() != null && other.getUnhealthyThresholdCount().equals(this.getUnhealthyThresholdCount()) == false)
return false;
if (other.getMatcher() == null ^ this.getMatcher() == null)
return false;
if (other.getMatcher() != null && other.getMatcher().equals(this.getMatcher()) == false)
return false;
if (other.getTargetType() == null ^ this.getTargetType() == null)
return false;
if (other.getTargetType() != null && other.getTargetType().equals(this.getTargetType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getHealthCheckProtocol() == null) ? 0 : getHealthCheckProtocol().hashCode());
hashCode = prime * hashCode + ((getHealthCheckPort() == null) ? 0 : getHealthCheckPort().hashCode());
hashCode = prime * hashCode + ((getHealthCheckEnabled() == null) ? 0 : getHealthCheckEnabled().hashCode());
hashCode = prime * hashCode + ((getHealthCheckPath() == null) ? 0 : getHealthCheckPath().hashCode());
hashCode = prime * hashCode + ((getHealthCheckIntervalSeconds() == null) ? 0 : getHealthCheckIntervalSeconds().hashCode());
hashCode = prime * hashCode + ((getHealthCheckTimeoutSeconds() == null) ? 0 : getHealthCheckTimeoutSeconds().hashCode());
hashCode = prime * hashCode + ((getHealthyThresholdCount() == null) ? 0 : getHealthyThresholdCount().hashCode());
hashCode = prime * hashCode + ((getUnhealthyThresholdCount() == null) ? 0 : getUnhealthyThresholdCount().hashCode());
hashCode = prime * hashCode + ((getMatcher() == null) ? 0 : getMatcher().hashCode());
hashCode = prime * hashCode + ((getTargetType() == null) ? 0 : getTargetType().hashCode());
return hashCode;
}
@Override
public CreateTargetGroupRequest clone() {
return (CreateTargetGroupRequest) super.clone();
}
}