There are more AWS SDK examples available in the AWS Doc SDK Examples
Use DescribeTags with a CLI
The following code examples show how to use DescribeTags.
- CLI
-
- AWS CLI
-
To describe the tags assigned to a load balancer
This example describes the tags assigned to the specified load balancer.
Command:
aws elbv2 describe-tags --resource-arnsarn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188Output:
{ "TagDescriptions": [ { "ResourceArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "Tags": [ { "Value": "lima", "Key": "project" }, { "Value": "digital-media", "Key": "department" } ] } ] }-
For API details, see DescribeTags
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example lists the Tags for the specified resource.
Get-ELB2Tag -ResourceArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/test-alb/3651b4394dd9a24f'Output:
ResourceArn Tags ----------- ---- arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/test-alb/3651b4394dd9a24f {stage, internalName, version}-
For API details, see DescribeTags in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example lists the Tags for the specified resource.
Get-ELB2Tag -ResourceArn 'arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/test-alb/3651b4394dd9a24f'Output:
ResourceArn Tags ----------- ---- arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/test-alb/3651b4394dd9a24f {stage, internalName, version}-
For API details, see DescribeTags in AWS Tools for PowerShell Cmdlet Reference (V5).
-