TagResourceCommand

Associate tags with a resource. For more information, see Tagging resources  in the Amazon Bedrock User Guide .

Example Syntax

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

import { BedrockClient, TagResourceCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
// const { BedrockClient, TagResourceCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
const client = new BedrockClient(config);
const input = { // TagResourceRequest
  resourceARN: "STRING_VALUE", // required
  tags: [ // TagList // required
    { // Tag
      key: "STRING_VALUE", // required
      value: "STRING_VALUE", // required
    },
  ],
};
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 to tag.

tags
Required
Tag[] | undefined

Tags to associate with the resource.

TagResourceCommand Output

See TagResourceCommandOutput for details

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

Throws

Name
Fault
Details
AccessDeniedException
client

The request is denied because of missing access permissions.

InternalServerException
server

An internal server error occurred. Retry your request.

ResourceNotFoundException
client

The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.

ThrottlingException
client

The number of requests exceeds the limit. Resubmit your request later.

TooManyTagsException
client

The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.

ValidationException
client

Input validation failed. Check your request parameters and retry the request.

BedrockServiceException
Base exception class for all service exceptions from Bedrock service.