CreateTargetGroup
In this article:
CreateTargetGroup#
Description#
Request to create a target group.
Request Parameters#
Required parameters#
Name — The target group name.
Type: String
Required: Yes
Constraints: 1 to 32 ASCII characters
Port — The port on which targets receive requests.
Type: Integer
Required: Yes
Valid range: From 1 to 65535
Protocol — The protocol used to route traffic to targets.
Type: String
Required: Yes
Valid values:
TCP|UDP|HTTP
TargetType — The target type. A target group may contain targets of one type only.
Type: String
Required: No
Valid values:
instanceDefault value:
instance
VpcId — The ID of the VPC.
Type: String
Required: Yes
Optional parameters#
HealthCheckEnabled — Indicates whether health check is enabled.
Type: Boolean
Required: No
Valid values:
TrueDefault value:
True
HealthCheckIntervalSeconds — The amount of time between health checks of an individual target, in seconds.
Type: Integer
Required: No
Valid values:
10|30for ELB of the typenetwork; 5 to 300 for ELB of the typeapplicationDefault value:
30
HealthCheckProtocol — The HTTP path used to perform health checks on targets.
Type: String
Required: No
Default value:
/
HealthCheckPort — The port used to check target health. The
traffic-portvalue means that the port, on which the target receives requests, is used for health checks.Type: String
Required: No
Valid values:
traffic-portDefault value:
traffic-port
HealthCheckProtocol — The protocol used to perform health checks on targets.
Type: String
Required: No
Constraints: It must match the protocol used by the target group
Valid values:
TCP|UDP|HTTP
HealthCheckTimeoutSeconds — The amount of time, after which no response from a target means a failed health check, in seconds.
Type: Integer
Required: No
Range: 2 to 120
Constraints: Cannot be changed for ELB of the
networktypeDefault value:
10for ELB of the typenetwork,5for ELF of the typeapplication
HealthyThresholdCount — Number of successful health checks after which the target status changes to
healthy.Type: Integer
Required: No
Valid range: From 2 to 10
Constraints: For ELB of the type
network, the value must match the value of UnhealthyThresholdCountDefault value:
3forTCPandUDPtarget groups,5forHTTPtarget groups
Matcher — The HTTP codes to use when checking for a successful response from a target.
Type: Matcher object
Required: No
Default value:
200
ProtocolVersion — HTTP protocol version, for an ELB of the type
application.Type: String
Required: No
Valid values:
HTTP1
UnhealthyThresholdCount — Number of unsuccessful health checks after which the target status changes to
unhealthy.Type: Integer
Required: No
Valid range: From 2 to 10
Constraints: For ELB of the type
network, the value must match the value of HealthyThresholdCountDefault value:
3forTCPandUDPtarget groups,2forHTTPtarget groups
Tags.N — Tags assigned to the target group.
Type: List of Tag objects
Required: No
Response Elements#
TargetGroups.N — Information about target groups.
Type: List of TargetGroup objects
Examples#
c2-elb CreateTargetGroup Name "tgname" VpcId "vpc_id" Port 80 Protocol tcp
c2-elb CreateTargetGroup Name "http-tg" VpcId "vpc_id" Port 8080 Protocol http
c2-elb CreateTargetGroup Name "tgname" VpcId "vpc_id" Port 8080 Protocol udp HealthCheckIntervalSeconds 10