Adds tags to a customer master key (CMK), secret, or certificate.
Operation description
You can add up to 10 tags to a CMK, secret, or certificate.
In this example, the tags [{"TagKey":"S1key1","TagValue":"S1val1"},{"TagKey":"S1key2","TagValue":"S2val2"}] are added to the CMK whose ID is 08c33a6f-4e0a-4a1b-a3fa-7ddf****.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| KeyId | string | No | The ID of the customer master key (CMK). The ID must be globally unique. Note
You can configure only one of the KeyId, SecretName, and CertificateId parameters.
| 08c33a6f-4e0a-4a1b-a3fa-7ddf**** |
| Tags | string | Yes | One or more tags that you want to add. The value is in the array format. Tag attributes:
| [{"TagKey":"S1key1","TagValue":"S1val1"},{"TagKey":"S1key2","TagValue":"S2val2"}] |
| SecretName | string | No | The name of the secret. Note
You can configure only one of the KeyId, SecretName, and CertificateId parameters.
| MyDbC**** |
| CertificateId | string | No | The ID of the certificate. Note
You can configure only one of the KeyId, SecretName, and CertificateId parameters.
| 770dbe42-e146-43d1-a55a-1355db86**** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "4162a6af-bc99-40b3-a552-89dcc8aaf7c8"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is not valid. | An invalid value is specified for the parameter. |
| 404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. | - |
For a list of error codes, visit the Service error codes.
