TagResource - AWS IoT

TagResource

Adds to or modifies the tags of the specified resource. Tags are metadata which can be used to manage a resource.

Note

AWS will discontinue the AWS IoT Device Management Fleet Hub feature on October 18, 2025 and is no longer accepting new customers. Existing AWS IoT Device Management Fleet Hub customers will be able to use Fleet Hub until October 17, 2025. For more information, Fleet Hub end-of-life (EOL) FAQs.

Request Syntax

POST /tags/resourceArn HTTP/1.1 Content-type: application/json { "tags": { "string" : "string" } }

URI Request Parameters

The request uses the following URI parameters.

resourceArn

The ARN of the resource.

Required: Yes

Request Body

The request accepts the following data in JSON format.

tags

The new or modified tags for the resource.

Type: String to string map

Map Entries: Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Value Length Constraints: Minimum length of 0. Maximum length of 256.

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

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: