- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
TagResourceCommand
Add a list of tags to a resource.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { PersonalizeClient, TagResourceCommand } from "@aws-sdk/client-personalize"; // ES Modules import
// const { PersonalizeClient, TagResourceCommand } = require("@aws-sdk/client-personalize"); // CommonJS import
const client = new PersonalizeClient(config);
const input = { // TagResourceRequest
resourceArn: "STRING_VALUE", // required
tags: [ // Tags // required
{ // Tag
tagKey: "STRING_VALUE", // required
tagValue: "STRING_VALUE", // required
},
],
};
const command = new TagResourceCommand(input);
const response = await client.send(command);
// {};
TagResourceCommand Input
See TagResourceCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
resourceArn Required | string | undefined | The resource's Amazon Resource Name (ARN). |
tags Required | Tag[] | undefined | Tags to apply to the resource. For more information see Tagging Amazon Personalize resources . |
TagResourceCommand Output
See TagResourceCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInputException | client | Provide a valid value for the field or parameter. |
LimitExceededException | client | The limit on the number of requests per second has been exceeded. |
ResourceInUseException | client | The specified resource is in use. |
ResourceNotFoundException | client | Could not find the specified resource. |
TooManyTagsException | client | You have exceeded the maximum number of tags you can apply to this resource. |
PersonalizeServiceException | Base exception class for all service exceptions from Personalize service. |