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:
instance
Default 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:
True
Default value:
True
HealthCheckIntervalSeconds — The amount of time between health checks of an individual target, in seconds.
Type: Integer
Required: No
Valid values:
10
|30
for ELB of the typenetwork
; 5 to 300 for ELB of the typeapplication
Default 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-port
value means that the port, on which the target receives requests, is used for health checks.Type: String
Required: No
Valid values:
traffic-port
Default 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
network
typeDefault value:
10
for ELB of the typenetwork
,5
for 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
Ограничения: Для ELB с типом
network
значение должно совпадать со значением опции UnhealthyThresholdCountDefault value:
3
forTCP
andUDP
target groups,5
forHTTP
target groups
Matcher - Описание кода ответа, при соответствии которому целевой ресурс считается доступным.
Тип: Объект :ref: Matcher
Required: No
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
Ограничения: Для ELB с типом
network
значение должно совпадать со значением опции HealthyThresholdCountDefault value:
3
forTCP
andUDP
target groups,2
forHTTP
target 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