Tagging Amazon Polly resources
A tag is a custom attribute label that you or Amazon assigns to an Amazon resource.
Tags help you do the following:
-
Identify and organize your Amazon resources. Many Amazon services support tagging. You can assign the same tag to resources from different services to indicate that the resources are related. For example, you can assign the same tag to a Amazon Polly lexicon that you assign to the Amazon Lambda function that uses it.
-
Control access to your resources. You can use tags in the
Conditionelement of an IAM policy to allow or deny access to a lexicon based on its tags. For more information, see ABAC with Amazon Polly.
Note
Amazon Polly charges for speech synthesis by the number of characters synthesized, not per lexicon. If you activate a tag on a lexicon as a cost allocation tag, the charges for synthesis requests that use that lexicon aren't attributed to the tag.
Tags have two parts:
-
A tag key (for example,
CostCenter,Environment, orProject). Tag keys are case sensitive. -
An optional field known as a tag value (for example,
12345orProduction). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.
The following sections provide more information about tags for Amazon Polly.
Supported resources in Amazon Polly
The following resources in Amazon Polly support tagging:
-
Lexicons – You can tag lexicons when you create them by using the PutLexicon API, or when you upload them in the Amazon Polly console. You can add tags to existing lexicons by using the TagResource API. You can also view and manage the tags of a lexicon on its details page in the Amazon Polly console.
Lexicon ARNs have the following format:
arn:aws:polly:region:account-id:lexicon/LexiconName
For information about adding and managing tags, see Managing tags.
Permissions for tagging lexicons on creation
When you include tags in a PutLexicon request, Amazon Polly checks that you have
permission for both of the following actions on the lexicon:
-
polly:PutLexicon -
polly:TagResource
If you don't have permission for polly:TagResource, the request fails
with an access denied error and Amazon Polly doesn't create or update the lexicon. A
PutLexicon request without tags only requires
polly:PutLexicon.
The AmazonPollyFullAccess managed policy includes both permissions. For
more information about managed policies, see Amazon managed (predefined) policies for Amazon Polly.
You can include tags in a PutLexicon request only when the request
creates a lexicon. If a lexicon with the same name already exists, a
PutLexicon request that includes tags fails with a
ValidationException, and Amazon Polly doesn't change the lexicon or its tags. To
add, change, or remove the tags of an existing lexicon, use TagResource and
UntagResource.
A PutLexicon request without tags that overwrites an existing lexicon
replaces the lexicon content and keeps the tags that the lexicon already has. It
doesn't remove them.
Managing tags
Tags consist of the Key and Value properties on a resource.
You can use the Amazon Polly console, the Amazon CLI, or the Amazon Polly API to add, edit, or delete the
values for these properties.
For more information about tagging lexicons, see the following:
-
TagResource, UntagResource, and ListTagsForResource in the Amazon Polly API Reference
-
Working with Tag Editor in the Resource Groups User Guide. You can use Tag Editor to find Amazon Polly lexicons by tag and to add, change, or remove their tags together with the tags of resources from other services.
Tag limits and conventions
Each Amazon Polly resource can have a maximum of 50 tags. The aws: prefix is
reserved for Amazon use, so you can't use it in tag keys or values that you create. For
tag naming limits, character requirements, and recommended naming strategies that apply
to all Amazon resources, see Best practices and strategies in the Tagging Amazon Resources and
Tag Editor User Guide.
Don't store sensitive information, such as personal or confidential data, in tags. For more information, see Data Protection in Amazon Polly.