Using Tagging - Amazon Kinesis Data Analytics for SQL Applications Developer Guide
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).

For new projects, we recommend that you use the new Managed Service for Apache Flink Studio over Kinesis Data Analytics for SQL Applications. Managed Service for Apache Flink Studio combines ease of use with advanced analytical capabilities, enabling you to build sophisticated stream processing applications in minutes.

Using Tagging

This section describes how to add key-value metadata tags to Kinesis Data Analytics applications. These tags can be used for the following purposes:

  • Determining billing for individual Kinesis Data Analytics applications. For more information, see Using Cost Allocation Tags in the Amazon Billing and Cost Management Guide.

  • Controlling access to application resources based on tags. For more information, see Controlling Access Using Tags in the User Guide.

  • User-defined purposes. You can define application functionality based on the presence of user tags.

Note the following information about tagging:

  • The maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.

  • If an action includes a tag list that has duplicate Key values, the service throws an InvalidArgumentException.

Adding Tags when an Application is Created

You add tags when creating an application using the tags parameter of the CreateApplication action.

The following example request shows the Tags node for a CreateApplication request:

"Tags": [ { "Key": "Key1", "Value": "Value1" }, { "Key": "Key2", "Value": "Value2" } ]

Adding or Updating Tags for an Existing Application

You add tags to an application using the TagResource action. You cannot add tags to an application using the UpdateApplication action.

To update an existing tag, add a tag with the same key of the existing tag.

The following example request for the TagResource action adds new tags or updates existing tags:

{ "ResourceARN": "string", "Tags": [ { "Key": "NewTagKey", "Value": "NewTagValue" }, { "Key": "ExistingKeyOfTagToUpdate", "Value": "NewValueForExistingTag" } ] }

Listing Tags for an Application

To list existing tags, you use the ListTagsForResource action.

The following example request for the ListTagsForResource action lists tags for an application:

{ "ResourceARN": "arn:aws:kinesisanalytics:us-west-2:012345678901:application/MyApplication" }

Removing Tags from an Application

To remove tags from an application, you use the UntagResource action.

The following example request for the UntagResource action removes tags from an application:

{ "ResourceARN": "arn:aws:kinesisanalytics:us-west-2:012345678901:application/MyApplication", "TagKeys": [ "KeyOfFirstTagToRemove", "KeyOfSecondTagToRemove" ] }