TagResource
Associates the specified tags to a resource with the specified resourceArn. If existing tags on a resource are not specified in the request parameters, they are not changed. If existing tags are specified, however, then their values will be updated. When a resource is deleted, the tags associated with that resource are deleted as well.
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) that identifies the resource for which to list the tags. Currently, the supported resources are
ConfigRule
,OrganizationConfigRule
,ConfigurationAggregator
,AggregationAuthorization
,ConformancePack
,OrganizationConformancePack
, andStoredQuery
.Type: String
Length Constraints: Minimum length of 1. Maximum length of 1000.
Required: Yes
- Tags
-
An array of tag object.
Type: Array of Tag objects
Array Members: Minimum number of 1 item. Maximum number of 50 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.
- ResourceNotFoundException
-
You have specified a resource that does not exist.
HTTP Status Code: 400
- TooManyTagsException
-
You have reached the limit of the number of tags you can use. For more information, see Service Limits in the AWS Config Developer Guide.
HTTP Status Code: 400
- ValidationException
-
The requested action is not valid.
For PutStoredQuery, you will see this exception if there are missing required fields or if the input value fails the validation, or if you are trying to create more than 300 queries.
For GetStoredQuery, ListStoredQuery, and DeleteStoredQuery you will see this exception if there are missing required fields or if the input value fails the validation.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: