

# TagResource
<a name="API_TagResource"></a>

Associates the specified tags to an Amazon EVS resource with the specified `resourceArn`. If existing tags on a resource are not specified in the request parameters, they aren't changed. When a resource is deleted, the tags associated with that resource are also deleted. Tags that you create for Amazon EVS resources don't propagate to any other resources associated with the environment. For example, if you tag an environment with this operation, that tag doesn't automatically propagate to the VLAN subnets and hosts associated with the environment.

## Request Syntax
<a name="API_TagResource_RequestSyntax"></a>

```
{
   "resourceArn": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_TagResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

**Note**  
In the following list, the required parameters are described first.

 ** [resourceArn](#API_TagResource_RequestSyntax) **   <a name="evs-TagResource-request-resourceArn"></a>
The Amazon Resource Name (ARN) of the resource to add tags to.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `arn:aws:evs:[a-z]{2}-[a-z]+-[0-9]:[0-9]{12}:environment/[a-zA-Z0-9_-]+`   
Required: Yes

 ** [tags](#API_TagResource_RequestSyntax) **   <a name="evs-TagResource-request-tags"></a>
Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don't propagate to any other environment or AWS resources.  
Type: String to string map  
Map Entries: Maximum number of 200 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `[\w.:/=+-@]+`   
Value Length Constraints: Minimum length of 0. Maximum length of 256.  
Value Pattern: `[\w.:/=+-@]+|`   
Required: Yes

## Response Elements
<a name="API_TagResource_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

## Errors
<a name="API_TagResource_Errors"></a>

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

 [ResourceNotFoundException](API_ResourceNotFoundException.md)   
A service resource associated with the request could not be found. The resource might not be specified correctly, or it may have a `state` of `DELETED`.    
 ** message **   
Describes the error encountered.  
 ** resourceId **   
The ID of the resource that could not be found.  
 ** resourceType **   
The type of the resource that is associated with the error.
HTTP Status Code: 400

 [ServiceQuotaExceededException](API_ServiceQuotaExceededException.md)   
The number of one or more Amazon EVS resources exceeds the maximum allowed. For a list of Amazon EVS quotas, see [Amazon EVS endpoints and quotas](https://docs.aws.amazon.com/evs/latest/userguide/service-quotas-evs.html) in the *Amazon EVS User Guide*. Delete some resources or request an increase in your service quota. To request an increase, see [AWS Service Quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) in the * AWS General Reference Guide*.     
 ** message **   
Describes the error encountered.
HTTP Status Code: 400

 [TagPolicyException](API_TagPolicyException.md)   
 `TagPolicyException` is deprecated. See [https://docs.aws.amazon.com/evs/latest/APIReference/API_ValidationException.html](https://docs.aws.amazon.com/evs/latest/APIReference/API_ValidationException.html) instead.
The request doesn't comply with IAM tag policy. Correct your request and then retry it.    
 ** message **   
Describes the error encountered
HTTP Status Code: 400

 [TooManyTagsException](API_TooManyTagsException.md)   
 `TooManyTagsException` is deprecated. See [https://docs.aws.amazon.com/evs/latest/APIReference/API_ServiceQuotaExceededException.html](https://docs.aws.amazon.com/evs/latest/APIReference/API_ServiceQuotaExceededException.html) instead.
A service resource associated with the request has more than 200 tags.    
 ** message **   
Describes the error encountered.
HTTP Status Code: 400

## See Also
<a name="API_TagResource_SeeAlso"></a>

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/evs-2023-07-27/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/evs-2023-07-27/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/evs-2023-07-27/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/evs-2023-07-27/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/evs-2023-07-27/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/evs-2023-07-27/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/evs-2023-07-27/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/evs-2023-07-27/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/evs-2023-07-27/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/evs-2023-07-27/TagResource) 