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 elb describe-tags --load-balancer-namemy-load-balancerOutput:
{ "TagDescriptions": [ { "Tags": [ { "Value": "lima", "Key": "project" }, { "Value": "digital-media", "Key": "department" } ], "LoadBalancerName": "my-load-balancer" } ] }-
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 load balancers.
Get-ELBResourceTag -LoadBalancerName @("my-load-balancer","my-internal-load-balancer")Output:
LoadBalancerName Tags ---------------- ---- my-load-balancer {project, department} my-internal-load-balancer {project, department}Example 2: This example describes the tags for the specified load balancer.
(Get-ELBResourceTag -LoadBalancerName my-load-balancer).TagsOutput:
Key Value --- ----- project lima department digital-media-
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 load balancers.
Get-ELBResourceTag -LoadBalancerName @("my-load-balancer","my-internal-load-balancer")Output:
LoadBalancerName Tags ---------------- ---- my-load-balancer {project, department} my-internal-load-balancer {project, department}Example 2: This example describes the tags for the specified load balancer.
(Get-ELBResourceTag -LoadBalancerName my-load-balancer).TagsOutput:
Key Value --- ----- project lima department digital-media-
For API details, see DescribeTags in AWS Tools for PowerShell Cmdlet Reference (V5).
-