Learn R Programming

paws.security.identity (version 0.1.0)

kms_tag_resource: Adds or edits tags for a customer master key (CMK)

Description

Adds or edits tags for a customer master key (CMK). You cannot perform this operation on a CMK in a different AWS account.

Usage

kms_tag_resource(KeyId, Tags)

Arguments

KeyId

[required] A unique identifier for the CMK you are tagging.

Specify the key ID or the Amazon Resource Name (ARN) of the CMK.

For example:

  • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

  • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.

Tags

[required] One or more tags. Each tag consists of a tag key and a tag value.

Request syntax

svc$tag_resource(
  KeyId = "string",
  Tags = list(
    list(
      TagKey = "string",
      TagValue = "string"
    )
  )
)

Details

Each tag consists of a tag key and a tag value. Tag keys and tag values are both required, but tag values can be empty (null) strings.

You can only use a tag key once for each CMK. If you use the tag key again, AWS KMS replaces the current tag value with the specified value.

For information about the rules that apply to tag keys and tag values, see User-Defined Tag Restrictions in the AWS Billing and Cost Management User Guide.

The result of this operation varies with the key state of the CMK. For details, see How Key State Affects Use of a Customer Master Key in the AWS Key Management Service Developer Guide.

Examples

Run this code
# NOT RUN {
# The following example tags a CMK.
# }
# NOT RUN {
svc$tag_resource(
  KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab",
  Tags = list(
    list(
      TagKey = "Purpose",
      TagValue = "Test"
    )
  )
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab