TagResourceCommand

Adds the specified tags to the specified resource.

Some of the supported resource types are agents, routing profiles, queues, quick connects, flows, agent statuses, hours of operation, phone numbers, security profiles, and task templates. For a complete list, see Tagging resources in Amazon Connect .

For sample policies that use tags, see Amazon Connect Identity-Based Policy Examples  in the Amazon Connect Administrator Guide.

Example Syntax

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

import { ConnectClient, TagResourceCommand } from "@aws-sdk/client-connect"; // ES Modules import
// const { ConnectClient, TagResourceCommand } = require("@aws-sdk/client-connect"); // CommonJS import
const client = new ConnectClient(config);
const input = { // TagResourceRequest
  resourceArn: "STRING_VALUE", // required
  tags: { // TagMap // required
    "<keys>": "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

The Amazon Resource Name (ARN) of the resource.

tags
Required
Record<string, string> | undefined

The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

TagResourceCommand Output

See TagResourceCommandOutput for details

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

Throws

Name
Fault
Details
InternalServiceException
server

Request processing failed because of an error or failure with the service.

InvalidParameterException
client

One or more of the specified parameters are not valid.

InvalidRequestException
client

The request is not valid.

ResourceNotFoundException
client

The specified resource was not found.

ThrottlingException
client

The throttling limit has been exceeded.

ConnectServiceException
Base exception class for all service exceptions from Connect service.