Allowing access to a KMS key from another account

0

I am trying to allow the use of my KMS key from 'Account A' in 'Account B', but I seem to be missing a step. Please let me know if you can see what I'm doing wrong.

The context is that I am sharing a DB snapshot, and the snapshot is encrypted using a CMK in Account A

What I have done: Following this document as guidance: https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html In Account A's KMS, I updated the key policy with the following: { "Sid": "Allow an external account to use this KMS key", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::<Account B>:root" }, "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": "*" } This key policy does have more, but there are no deny statements in it.

And then in Account B I have created a new IAM policy with the following: 
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowUseOfKeyInAccountA", "Effect": "Allow", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:ReEncrypt*", "kms:GenerateDataKey*", "kms:DescribeKey" ], "Resource": "arn:aws:kms:<REGION>:<ACCOUNTA>:key/<KEYID>" } ] } I attached this policy to the role I'm currently using and then logged out and back in again to the console. Then I went to the snapshots shared with me and attempted to copy that snapshot that was shared from Account A. When I try to save it off though, I get an error:

The source snapshot KMS key [arn:aws:kms:<REGION>:<ACCOUNTA>:key/<KEYID> matching the CMK ARN and policy above] does not exist, is not enabled or you do not have permissions to access it.

What step did I miss?

질문됨 일 년 전926회 조회
1개 답변
2
수락된 답변

It looks like what I was missing was

kms:CreateGrant

in my Account A CMK policy. Once added, I was able to do my snapshot copy

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠