- 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
Associates a set of tags with a Amazon Keyspaces resource. You can then activate these user-defined tags so that they appear on the Cost Management Console for cost allocation tracking. For more information, see Adding tags and labels to Amazon Keyspaces resources in the Amazon Keyspaces Developer Guide.
For IAM policy examples that show how to control access to Amazon Keyspaces resources based on tags, see Amazon Keyspaces resource access based on tags in the Amazon Keyspaces Developer Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { KeyspacesClient, TagResourceCommand } from "@aws-sdk/client-keyspaces"; // ES Modules import
// const { KeyspacesClient, TagResourceCommand } = require("@aws-sdk/client-keyspaces"); // CommonJS import
const client = new KeyspacesClient(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
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
resourceArn Required | string | undefined | The Amazon Resource Name (ARN) of the Amazon Keyspaces resource to which to add tags. |
tags Required | Tag[] | undefined | The tags to be assigned to the Amazon Keyspaces resource. |
TagResourceCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You don't have sufficient access permissions to perform this action. |
ConflictException | client | Amazon Keyspaces couldn't complete the requested action. This error may occur if you try to perform an action and the same or a different action is already in progress, or if you try to create a resource that already exists. |
InternalServerException | server | Amazon Keyspaces was unable to fully process this request because of an internal server error. |
ResourceNotFoundException | client | The operation tried to access a keyspace, table, or type that doesn't exist. The resource might not be specified correctly, or its status might not be |
ServiceQuotaExceededException | client | The operation exceeded the service quota for this resource. For more information on service quotas, see Quotas in the Amazon Keyspaces Developer Guide. |
ValidationException | client | The operation failed due to an invalid or malformed request. |
KeyspacesServiceException | Base exception class for all service exceptions from Keyspaces service. |