Use ListTags with an Amazon SDK or CLI - Amazon Lambda
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use ListTags with an Amazon SDK or CLI

The following code examples show how to use ListTags.

CLI
Amazon CLI

To retrieve the list of tags for a Lambda function

The following list-tags example displays the tags attached to the my-function Lambda function.

aws lambda list-tags \ --resource arn:aws:lambda:us-west-2:123456789012:function:my-function

Output:

{ "Tags": { "Category": "Web Tools", "Department": "Sales" } }

For more information, see Tagging Lambda Functions in the Amazon Lambda Developer Guide.

  • For API details, see ListTags in Amazon CLI Command Reference.

PowerShell
Tools for PowerShell

Example 1: Retrieves the tags and their values currently set on the specified function.

Get-LMResourceTag -Resource "arn:aws:lambda:us-west-2:123456789012:function:MyFunction"

Output:

Key Value --- ----- California Sacramento Oregon Salem Washington Olympia
  • For API details, see ListTags in Amazon Tools for PowerShell Cmdlet Reference.

For a complete list of Amazon SDK developer guides and code examples, see Using Lambda with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.