TagResource - AWS Global Accelerator

TagResource

Add tags to an accelerator resource. To see an AWS CLI example of adding tags to an accelerator, scroll down to Example.

For more information, see Tagging in AWS Global Accelerator in the AWS Global Accelerator Developer Guide.

Request Syntax

{ "ResourceArn": "string", "Tags": [ { "Key": "string", "Value": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ResourceArn

The Amazon Resource Name (ARN) of the Global Accelerator resource to add tags to. An ARN uniquely identifies a resource.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1011.

Required: Yes

Tags

The tags to add to a resource. A tag consists of a key and a value that you define.

Type: Array of Tag objects

Required: Yes

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.

AcceleratorNotFoundException

The accelerator that you specified doesn't exist.

HTTP Status Code: 400

InternalServiceErrorException

There was an internal error for AWS Global Accelerator.

HTTP Status Code: 400

InvalidArgumentException

An argument that you specified is invalid.

HTTP Status Code: 400

Example

Add tags to an accelerator

The following is an example for adding tags to an accelerator. When successful, this command has no output.

Note

Instead of using command line arguments, you can provide the tags in a JSON file. Then, for example, with a file called tags.json in the current folder, specify file://tags.json with the --tags parameter.

aws globalaccelerator tag-resource --resource-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh --tags Key="Name",Value="Example Name" Key="Project",Value="Example Project"

See Also

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