TagResource
Adds or overwrites one or more tags for the specified resource.
Request Syntax
{
"identifier": "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.
- identifier
-
The resource ID you want to tag.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Required: Yes
-
One or more tags. The value parameter is required.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
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.
- AccessDeniedException
-
User does not have sufficient access to perform this action.
HTTP Status Code: 400
- InternalServerException
-
The request failed because of an internal error. Try your request again later
HTTP Status Code: 500
- ResourceNotFoundException
-
The request failed because it references a resource that doesn't exist.
HTTP Status Code: 400
- ThrottlingException
-
The request failed because it exceeded a throttling quota.
HTTP Status Code: 400
- TooManyTagsException
-
Request exceeded maximum number of tag allowed..
HTTP Status Code: 400
- ValidationException
-
The input fails to satisfy the constraints specified by an AWS service.
HTTP Status Code: 400
Examples
This example illustrates one usage of TagResource
.
Example
Using AWS JSON protocol (default)
Sample Request
POST / HTTP/1.1
Host: ts.us-east-2.amazonaws.com
X-Amz-Target: Troubleshooting.TagResource
Content-Type: application/x-amz-json-1.0
X-Amz-Date: <Date>
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
{
"identifier": "e-aaaaaaaaaa"
"tags": [{
"key": "department",
"value": "support"
}]
}
Sample Response
HTTP/1.1 200 OK
x-amzn-RequestId: <requestId>
Content-Length: 0
Date: <Date>
Content-Type: application/x-amz-json-1.0
{}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: