

# TagResource


Assigns key-value pairs of metadata to AWS resources.

## Request Syntax


```
PUT /tags/ResourceArn HTTP/1.1
Content-type: application/json

{
   "Tags": { 
      "string" : "string" 
   }
}
```

## URI Request Parameters


The request uses the following URI parameters.

 ** [ResourceArn](#API_TagResource_RequestSyntax) **   <a name="quicksetup-TagResource-request-uri-ResourceArn"></a>
The ARN of the resource to tag.  
Required: Yes

## Request Body


The request accepts the following data in JSON format.

 ** [Tags](#API_TagResource_RequestSyntax) **   <a name="quicksetup-TagResource-request-Tags"></a>
Key-value pairs of metadata to assign to the resource.  
Type: String to string map  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `[A-Za-z0-9 _=@:.+-/]+`   
Value Length Constraints: Minimum length of 0. Maximum length of 256.  
Value Pattern: `[A-Za-z0-9 _=@:.+-/]+`   
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


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
The requester has insufficient permissions to perform the operation.  
HTTP Status Code: 403

 ** ConflictException **   
Another request is being processed. Wait a few minutes and try again.  
HTTP Status Code: 409

 ** InternalServerException **   
An error occurred on the server side.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The resource couldn't be found. Check the ID or name and try again.  
HTTP Status Code: 404

 ** ThrottlingException **   
The request or operation exceeds the maximum allowed request rate per AWS account and AWS Region.  
HTTP Status Code: 429

 ** ValidationException **   
The request is invalid. Verify the values provided for the request parameters are accurate.  
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/ssm-quicksetup-2018-05-10/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ssm-quicksetup-2018-05-10/TagResource) 