

# Tagging resources


With Amazon Textract, you can tag resources like adapters for the purposes of managing secure access. To tag resources, use an AWS SDK or the AWS CLI. The topics in this section demonstrate how to manage your tags using the CLI.

# Tag resource


Amazon Textract resources like adapters can be tagged using the [TagResource](API_TagResource.md) operation. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. To tag a resource, use the `TagResource` operation and specify a list of tags as key-value pairs.

To tag a resource with the AWS CLI or AWS SDK:
+ If you haven't already done so, install and configure the AWS CLI and the AWS SDKs. For more information, see [Step 2: Set Up the AWS CLI and AWS SDKs](setup-awscli-sdk.md).
+ Use the following code to create an adapter: 

------
#### [ CLI ]

```
aws textract tag-resource  --resource-arn arn:aws:textract:us-east-1:000000000000:/adapters/a1b2c3d4e5c6 --tags Tag=Key
```

------

# List tags for resource


 Amazon Textract resources like adapters can be tagged using the [TagResource](API_TagResource.md) operation. You can list all the tags associated with a resource by using the [ListTagsForResource](API_ListTagsForResource.md) operation and providing the Amazon Resource Name (ARN) associated with the resource that you want to retrieve tags for. 

To list tags for a resource with the AWS CLI or AWS SDK:
+ If you haven't already done so, install and configure the AWS CLI and the AWS SDKs. For more information, see [Step 2: Set Up the AWS CLI and AWS SDKs](setup-awscli-sdk.md).
+ Use the following code to create an adapter: 

------
#### [ CLI ]

```
aws textract list-tags-for-resource --region us-east-1 --resource-arn arn:aws:textract:us-east-1:000000000000:/adapters/a1b2c3d4e5c6 \
{
    "Tags": {
        "Tag": "Key"
    }
}
```

------

# Untag resource


Amazon Textract resources like adapters can be tagged using the [TagResource](API_TagResource.md) operation. You can remove any tags you no longer need from a resource by using the [UntagResource](API_UntagResource.md) operation. When calling `UntagResource`, provide the Amazon Resource Name (ARN) of the resource that you want to remove tags from. Also include a list of the tag-specific key values that you want to remove from the resource. 

To untag a resource with the AWS CLI or AWS SDK:
+  If you haven't already done so, install and configure the AWS CLI and the AWS SDKs. For more information, see [Step 2: Set Up the AWS CLI and AWS SDKs](setup-awscli-sdk.md).
+ Use the following code to create an adapter: 

------
#### [ CLI ]

```
aws textract untag-resource --region us-east-1 arn:aws:textract:us-east-1:000000000000:/adapters/a1b2c3d4e5c6  --tag-keys Tag
```

------