TagResourceCommand

Adds tags to the specified resource.

Example Syntax

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

import { NeptuneGraphClient, TagResourceCommand } from "@aws-sdk/client-neptune-graph"; // ES Modules import
// const { NeptuneGraphClient, TagResourceCommand } = require("@aws-sdk/client-neptune-graph"); // CommonJS import
const client = new NeptuneGraphClient(config);
const input = { // TagResourceInput
  resourceArn: "STRING_VALUE", // required
  tags: { // TagMap // required
    "<keys>": "STRING_VALUE",
  },
};
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

ARN of the resource for which tags need to be added.

tags
Required
Record<string, string> | undefined

The tags to be assigned to the Neptune Analytics resource.

The tags are metadata that are specified as a list of key-value pairs:

Key (string) – A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length. It can't be prefixed with aws: and can only contain the set of Unicode characters specified by this Java regular expression: "^([p{L}p{Z}p{N}_.:/=+-]*)$").

Value (string) – A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length. It can't be prefixed with aws: and can only contain the set of Unicode characters specified by this Java regular expression: "^([p{L}p{Z}p{N}_.:/=+-]*)$").

TagResourceCommand Output

See TagResourceCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
InternalServerException
server

A failure occurred on the server.

ResourceNotFoundException
client

A specified resource could not be located.

ThrottlingException
client

The exception was interrupted by throttling.

ValidationException
client

A resource could not be validated.

NeptuneGraphServiceException
Base exception class for all service exceptions from NeptuneGraph service.