TagResource
Adds tags to the specified resource.
Request Syntax
{
"clientToken": "string",
"resourceArn": "string",
"ruleRevision": number,
"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.
- clientToken
-
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.
Type: String
Pattern:
[a-zA-Z0-9_-]{1,64}Required: No
- resourceArn
-
The ARN of the resource to tag.
Type: String
Pattern:
arn:aws:compute-optimizer::[0-9]{12}:automation-rule/[a-zA-Z0-9_-]+Required: Yes
- ruleRevision
-
The revision number of the automation rule to tag. This ensures you're tagging the correct version of the rule.
Type: Long
Required: Yes
-
The tags to add to the resource.
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
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 400
- ForbiddenException
-
You are not authorized to perform this action.
HTTP Status Code: 400
- IdempotencyTokenInUseException
-
The specified client token is already in use.
HTTP Status Code: 400
- IdempotentParameterMismatchException
-
Exception thrown when the same client token is used with different parameters, indicating a mismatch in idempotent request parameters.
HTTP Status Code: 400
- InternalServerException
-
An internal error occurred while processing the request.
HTTP Status Code: 500
- InvalidParameterValueException
-
One or more parameter values are not valid.
HTTP Status Code: 400
- OptInRequiredException
-
The account must be opted in to Compute Optimizer Automation before performing this action.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
HTTP Status Code: 400
- ServiceUnavailableException
-
The service is temporarily unavailable.
HTTP Status Code: 500
- ThrottlingException
-
The request was denied due to request throttling.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: