DescribeTargetGroups
Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.
To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a target group, use DescribeTargetGroupAttributes.
Request Syntax
{
"LoadBalancerArn": "string
",
"Marker": "string
",
"Names": [ "string
" ],
"PageSize": number
,
"TargetGroupArns": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- LoadBalancerArn
-
The Amazon Resource Name (ARN) of the load balancer.
Type: String
Required: No
- Marker
-
The marker for the next set of results. (You received this marker from a previous call.)
Type: String
Required: No
- Names
-
The names of the target groups.
Type: Array of strings
Required: No
- PageSize
-
The maximum number of results to return with this call.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 400.
Required: No
- TargetGroupArns
-
The Amazon Resource Names (ARN) of the target groups.
Type: Array of strings
Required: No
Response Syntax
{
"NextMarker": "string",
"TargetGroups": [
{
"HealthCheckEnabled": boolean,
"HealthCheckIntervalSeconds": number,
"HealthCheckPath": "string",
"HealthCheckPort": "string",
"HealthCheckProtocol": "string",
"HealthCheckTimeoutSeconds": number,
"HealthyThresholdCount": number,
"IpAddressType": "string",
"LoadBalancerArns": [ "string" ],
"Matcher": {
"GrpcCode": "string",
"HttpCode": "string"
},
"Port": number,
"Protocol": "string",
"ProtocolVersion": "string",
"TargetGroupArn": "string",
"TargetGroupName": "string",
"TargetType": "string",
"UnhealthyThresholdCount": number,
"VpcId": "string"
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- NextMarker
-
If there are additional results, this is the marker for the next set of results. Otherwise, this is null.
Type: String
- TargetGroups
-
Information about the target groups.
Type: Array of TargetGroup objects
Errors
For information about the errors that are common to all actions, see Common Errors.
- LoadBalancerNotFoundException
-
The specified load balancer does not exist.
HTTP Status Code: 400
- TargetGroupNotFoundException
-
The specified target group does not exist.
HTTP Status Code: 400
Examples
Describe a target group
This example describes the specified target group.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups
&TargetGroupArns.member.1=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067
&Version=2015-12-01
&AUTHPARAMS
Sample Response
<DescribeTargetGroupsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeTargetGroupsResult>
<TargetGroups>
<member>
<TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn>
<HealthCheckTimeoutSeconds>5</HealthCheckTimeoutSeconds>
<HealthCheckPort>traffic-port</HealthCheckPort>
<Matcher>
<HttpCode>200</HttpCode>
</Matcher>
<TargetGroupName>my-targets</TargetGroupName>
<HealthCheckProtocol>HTTP</HealthCheckProtocol>
<HealthCheckPath>/</HealthCheckPath>
<Protocol>HTTP</Protocol>
<Port>80</Port>
<VpcId>vpc-3ac0fb5f</VpcId>
<HealthyThresholdCount>5</HealthyThresholdCount>
<HealthCheckIntervalSeconds>30</HealthCheckIntervalSeconds>
<LoadBalancerArns>
<member>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</member>
</LoadBalancerArns>
<UnhealthyThresholdCount>2</UnhealthyThresholdCount>
</member>
</TargetGroups>
</DescribeTargetGroupsResult>
<ResponseMetadata>
<RequestId>70092c0e-f3a9-11e5-ae48-cff02092876b</RequestId>
</ResponseMetadata>
</DescribeTargetGroupsResponse>
Describe all target groups for a load balancer
This example describes all target groups for the specified load balancer.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups
&LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188
&Version=2015-12-01
&AUTHPARAMS
Describe all target groups
This example describes all of your target groups.
Sample Request
https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups
&Version=2015-12-01
&AUTHPARAMS
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: