TagResource - Amazon RAM
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

TagResource

Adds the specified tag keys and values to a resource share or managed permission. If you choose a resource share, the tags are attached to only the resource share, not to the resources that are in the resource share.

The tags on a managed permission are the same for all versions of the managed permission.

Request Syntax

POST /tagresource HTTP/1.1 Content-type: application/json { "resourceArn": "string", "resourceShareArn": "string", "tags": [ { "key": "string", "value": "string" } ] }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

tags

A list of one or more tag key and value pairs. The tag key must be present and not be an empty string. The tag value must be present but can be an empty string.

Type: Array of Tag objects

Required: Yes

resourceArn

Specifies the Amazon Resource Name (ARN) of the managed permission that you want to add tags to. You must specify either resourceArn, or resourceShareArn, but not both.

Type: String

Required: No

resourceShareArn

Specifies the Amazon Resource Name (ARN) of the resource share that you want to add tags to. You must specify either resourceShareArn, or resourceArn, but not both.

Type: String

Required: No

Response Syntax

HTTP/1.1 200

Response Elements

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidParameterException

The operation failed because a parameter you specified isn't valid.

HTTP Status Code: 400

MalformedArnException

The operation failed because the specified Amazon Resource Name (ARN) has a format that isn't valid.

HTTP Status Code: 400

ResourceArnNotFoundException

The operation failed because the specified Amazon Resource Name (ARN) was not found.

HTTP Status Code: 400

ServerInternalException

The operation failed because the service could not respond to the request due to an internal problem. Try again later.

HTTP Status Code: 500

ServiceUnavailableException

The operation failed because the service isn't available. Try again later.

HTTP Status Code: 503

TagLimitExceededException

The operation failed because it would exceed the limit for tags for your Amazon Web Services account.

HTTP Status Code: 400

TagPolicyViolationException

The operation failed because the specified tag key is a reserved word and can't be used.

HTTP Status Code: 400

UnknownResourceException

The operation failed because a specified resource couldn't be found.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: