TagResource
Associates the specified tags to a resource with the specified resourceArn
.
If existing tags on a resource aren't specified in the request parameters, they aren't
changed. When a resource is deleted, the tags associated with that resource are also
deleted.
Request Syntax
PUT /v20190125/tag?resourceArn=resourceArn
HTTP/1.1
Content-type: application/json
{
"tags": [
{
"key": "string
",
"value": "string
"
}
]
}
URI Request Parameters
The request uses the following URI parameters.
- resourceArn
-
The Amazon Resource Name (ARN) of the resource to add tags to.
Required: Yes
Request Body
The request accepts the following data in JSON format.
-
The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
Type: Array of TagRef objects
Array Members: Minimum number of 0 items. Maximum number of 50 items.
Required: Yes
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
- BadRequestException
-
The request syntax was malformed. Check your request syntax and try again.
HTTP Status Code: 400
- ForbiddenException
-
You don't have permissions to perform this action.
HTTP Status Code: 403
- InternalServerErrorException
-
The request processing has failed because of an unknown error, exception, or failure.
HTTP Status Code: 500
- NotFoundException
-
The specified resource doesn't exist. Check your request syntax and try again.
HTTP Status Code: 404
- ServiceUnavailableException
-
The request has failed due to a temporary failure of the service.
HTTP Status Code: 503
- TooManyRequestsException
-
The maximum request rate permitted by the App Mesh APIs has been exceeded for your account. For best results, use an increasing or variable sleep interval between requests.
HTTP Status Code: 429
- TooManyTagsException
-
The request exceeds the maximum allowed number of tags allowed per resource. The current limit is 50 user tags per resource. You must reduce the number of tags in the request. None of the tags in this request were applied.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: