TagResourceCommand

Adds one or more tags to an Athena resource. A tag is a label that you assign to a resource. Each tag consists of a key and an optional value, both of which you define. For example, you can use tags to categorize Athena workgroups, data catalogs, or capacity reservations by purpose, owner, or environment. Use a consistent set of tag keys to make it easier to search and filter the resources in your account. For best practices, see Tagging Best Practices . Tag keys can be from 1 to 128 UTF-8 Unicode characters, and tag values can be from 0 to 256 UTF-8 Unicode characters. Tags can use letters and numbers representable in UTF-8, and the following characters: + - = . _ : / . Tag keys and values are case-sensitive. Tag keys must be unique per resource. If you specify more than one tag, separate them by commas.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AthenaClient, TagResourceCommand } from "@aws-sdk/client-athena"; // ES Modules import
// const { AthenaClient, TagResourceCommand } = require("@aws-sdk/client-athena"); // CommonJS import
const client = new AthenaClient(config);
const input = { // TagResourceInput
  ResourceARN: "STRING_VALUE", // required
  Tags: [ // TagList // required
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
};
const command = new TagResourceCommand(input);
const response = await client.send(command);
// {};

TagResourceCommand Input

See TagResourceCommandInput for more details

Parameter
Type
Description
ResourceARN
Required
string | undefined

Specifies the ARN of the Athena resource to which tags are to be added.

Tags
Required
Tag[] | undefined

A collection of one or more tags, separated by commas, to be added to an Athena resource.

TagResourceCommand Output

See TagResourceCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalServerException
server

Indicates a platform issue, which may be due to a transient condition or outage.

InvalidRequestException
client

Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.

ResourceNotFoundException
client

A resource, such as a workgroup, was not found.

AthenaServiceException
Base exception class for all service exceptions from Athena service.