TagResourceCommand

Adds one or more tags (keys and values) to a specified resource.

Example Syntax

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

import { MailManagerClient, TagResourceCommand } from "@aws-sdk/client-mailmanager"; // ES Modules import
// const { MailManagerClient, TagResourceCommand } = require("@aws-sdk/client-mailmanager"); // CommonJS import
const client = new MailManagerClient(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 that you want to tag.

Tags
Required
Tag[] | undefined

The tags used to organize, track, or control access for the 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
ConflictException
client

The request configuration has conflicts. For details, see the accompanying error message.

ResourceNotFoundException
client

Occurs when a requested resource is not found.

ServiceQuotaExceededException
client

Occurs when an operation exceeds a predefined service quota or limit.

ValidationException
client

The request validation has failed. For details, see the accompanying error message.

MailManagerServiceException
Base exception class for all service exceptions from MailManager service.