Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreateTagsCommand

Adds or overwrites only the specified tags for the specified Amazon EC2 resource or resources. When you specify an existing tag key, the value is overwritten with the new value. Each resource can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique per resource.

For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide. For more information about creating IAM policies that control users' access to resources based on tags, see Supported Resource-Level Permissions for Amazon EC2 API Actions in the Amazon Elastic Compute Cloud User Guide.

example

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

import { EC2Client, CreateTagsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, CreateTagsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const command = new CreateTagsCommand(input);
const response = await client.send(command);
see

CreateTagsCommandInput for command's input shape.

see

CreateTagsCommandOutput for command's response shape.

see

config for EC2Client's config shape.

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

Properties

Readonly input

input: CreateTagsCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<CreateTagsCommandInput, CreateTagsCommandOutput>