- 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.
CreateTagsCommand
Adds tags to a cluster.
A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, you will receive an error and the attempt will fail.
If you specify a key that already exists for the resource, the value for that key will be updated with the new value.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { RedshiftClient, CreateTagsCommand } from "@aws-sdk/client-redshift"; // ES Modules import
// const { RedshiftClient, CreateTagsCommand } = require("@aws-sdk/client-redshift"); // CommonJS import
const client = new RedshiftClient(config);
const input = { // CreateTagsMessage
ResourceName: "STRING_VALUE", // required
Tags: [ // TagList // required
{ // Tag
Key: "STRING_VALUE",
Value: "STRING_VALUE",
},
],
};
const command = new CreateTagsCommand(input);
const response = await client.send(command);
// {};
CreateTagsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ResourceName Required | string | undefined | The Amazon Resource Name (ARN) to which you want to add the tag or tags. For example, |
Tags Required | Tag[] | undefined | One or more name/value pairs to add as tags to the specified resource. Each tag name is passed in with the parameter |
CreateTagsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidClusterStateFault | client | The specified cluster is not in the |
InvalidTagFault | client | The tag is invalid. |
ResourceNotFoundFault | client | The resource could not be found. |
TagLimitExceededFault | client | You have exceeded the number of tags allowed. |
RedshiftServiceException | Base exception class for all service exceptions from Redshift service. |