TagResource - Amazon Key Management Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

TagResource

以下示例显示了一个Amazon CloudTrail日志条目调用TagResource操作添加标签键为Department和标签值IT

有关UntagResource轮换密钥时写入的 CloudTrail 日志条目,请参阅UntagResource。有关标记的信息Amazon KMS客户主密钥,请参阅。标记密钥

{ "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "EX_PRINCIPAL_ID", "arn": "arn:aws:iam::111122223333:user/Alice", "accountId": "111122223333", "accessKeyId": "EXAMPLE_KEY_ID", "userName": "Alice" }, "eventTime": "2020-07-01T21:19:25Z", "eventSource": "kms.amazonaws.com", "eventName": "TagResource", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.0", "userAgent": "Amazon Internal", "requestParameters": { "keyId": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", "tags": [ { "tagKey": "Department", "tagValue": "IT" } ] }, "responseElements": null, "requestID": "b942584a-f77d-4787-9feb-b9c5be6e746d", "eventID": "0a091b9b-0df5-4cf9-b667-6f2879532b8f", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::KMS::Key", "ARN": "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" } ], "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }