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

Description Usage Arguments Details Request syntax Examples

View source: R/kms_operations.R

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

1
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.

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.

Request syntax

1
2
3
4
5
6
7
8
9
svc$tag_resource(
  KeyId = "string",
  Tags = list(
    list(
      TagKey = "string",
      TagValue = "string"
    )
  )
)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# The following example tags a CMK.
svc$tag_resource(
  KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab",
  Tags = list(
    list(
      TagKey = "Purpose",
      TagValue = "Test"
    )
  )
)

paws.security.identity documentation built on Oct. 30, 2019, 11:26 a.m.