I Tried Associating an Additional KMS Key with an Amazon EBS Snapshot

I Tried Associating an Additional KMS Key with an Amazon EBS Snapshot

Amazon EBS snapshots can now be associated with an additional KMS key. Snapshots encrypted with an AWS managed key can be shared with another account by associating a customer managed key.
2026.11.19

This page has been translated by machine translation. View original

Introduction

On November 16, 2026, it became possible to associate additional KMS keys with Amazon EBS snapshots.

https://aws.amazon.com/about-aws/whats-new/2026/11/ebs-snapshots-associate-kms-keys/

Snapshots encrypted with an AWS managed key (aws/ebs) cannot be shared with another account as they are. With this update, you can later associate a KMS key separate from the original key, so that the snapshot can be decrypted in the target account as well.

In this article, I associated a customer managed key (CMK) with a snapshot encrypted with an AWS managed key (aws/ebs), and confirmed that the target account can copy the snapshot and create a volume from it.

Test Environment

  • Region: Tokyo (ap-northeast-1)
  • Accounts: two, a source account and a target account. Operations in the target account were run with a role that has administrator privileges
  • What I prepared in the source account
    • A 1 GiB volume encrypted with aws/ebs and its snapshot
    • CMK-A used for the association. The key policy allows the target account to use the key
  • AWS CLI: 2.40.4
Key policy for CMK-A and the creation command

Save the following content as cmk-a-key-policy.json. Put the source account ID in <SOURCE_ACCOUNT_ID> and the target account ID in <TARGET_ACCOUNT_ID>.

{
  "Version": "2012-10-17",
  "Id": "ebs-associated-key-policy-grant-condition",
  "Statement": [
    {
      "Sid": "EnableIAMInSourceAccount",
      "Effect": "Allow",
      "Principal": {"AWS": "arn:aws:iam::<SOURCE_ACCOUNT_ID>:root"},
      "Action": "kms:*",
      "Resource": "*"
    },
    {
      "Sid": "AllowTargetAccountToUseKeyForEbsSnapshotCopy",
      "Effect": "Allow",
      "Principal": {"AWS": "arn:aws:iam::<TARGET_ACCOUNT_ID>:root"},
      "Action": [
        "kms:DescribeKey",
        "kms:GenerateDataKey",
        "kms:GenerateDataKeyWithoutPlaintext",
        "kms:ReEncryptFrom",
        "kms:ReEncryptTo",
        "kms:Decrypt"
      ],
      "Resource": "*"
    },
    {
      "Sid": "AllowTargetAccountToCreateGrantForAwsResources",
      "Effect": "Allow",
      "Principal": {"AWS": "arn:aws:iam::<TARGET_ACCOUNT_ID>:root"},
      "Action": "kms:CreateGrant",
      "Resource": "*",
      "Condition": {"Bool": {"kms:GrantIsForAWSResource": "true"}}
    }
  ]
}

Pass this file to create the key in the source account.

# Run in the source account
aws kms create-key \
  --description "ebs-assoc-verify CMK-A (source account)" \
  --tags TagKey=purpose,TagValue=ebs-assoc-verify \
  --policy file://cmk-a-key-policy.json

Association and Sharing

Sharing Before Association

Before associating the key, I tried to share the snapshot encrypted with aws/ebs with the target account, and it was rejected.

# Run in the source account
aws ec2 modify-snapshot-attribute \
  --snapshot-id snap-1234567890abcdef0 \
  --attribute createVolumePermission \
  --operation-type add \
  --user-ids 444455556666
aws: [ERROR]: An error occurred (OperationNotPermitted) when calling the ModifySnapshotAttribute operation: Encrypted snapshots with EBS default key cannot be shared

Associating the Key

Pass the snapshot ID to --snapshot-id of associate-kms-key-id, and the ARN of the key to associate to --kms-key-id.

# Run in the source account
aws ec2 associate-kms-key-id \
  --snapshot-id snap-1234567890abcdef0 \
  --kms-key-id arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
{
    "Return": true
}

In the output (excerpt) of describe-snapshots after the association, the associated key appeared in AssociatedKmsKeys, and KmsKeyId remained the original key.

"AssociatedKmsKeys": [
    {
        "KmsKeyId": "arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
    }
],
"Encrypted": true,
"KmsKeyId": "arn:aws:kms:ap-northeast-1:111122223333:key/aaaabbbb-cccc-dddd-eeee-ffff00001111"

Sharing

The sharing operation is the same as before. The modify-snapshot-attribute that was rejected before the association succeeded with no output after the association.

When I ran describe-snapshots from the target account, AssociatedKmsKeys and KmsKeyId returned the same values as those I saw in the source account.

Use in the Target Account

Copy

In the target account, I ran one copy that passed the ARN of CMK-A shown in AssociatedKmsKeys to --kms-key-id, and one copy with no key specified.

# Run in the target account
aws ec2 copy-snapshot \
  --source-region ap-northeast-1 \
  --source-snapshot-id snap-1234567890abcdef0 \
  --encrypted \
  --kms-key-id arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab \
  --description copy-with-cmk-a

# Run in the target account
aws ec2 copy-snapshot \
  --source-region ap-northeast-1 \
  --source-snapshot-id snap-1234567890abcdef0 \
  --encrypted \
  --description copy-default-key

This is the result (excerpt) of checking the completed copies with describe-snapshots.

[
    {
        "SnapshotId": "snap-0a1b2c3d4e5f67890",
        "State": "completed",
        "Progress": "100%",
        "StateMessage": null,
        "Encrypted": true,
        "KmsKeyId": "arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
        "Description": "copy-with-cmk-a"
    },
    {
        "SnapshotId": "snap-0b2c3d4e5f6a78901",
        "State": "completed",
        "Progress": "100%",
        "StateMessage": null,
        "Encrypted": true,
        "KmsKeyId": "arn:aws:kms:ap-northeast-1:444455556666:key/22223333-4444-5555-6666-77778888aaaa",
        "Description": "copy-default-key"
    }
]

The copy with CMK-A specified was encrypted with CMK-A, and the copy with no key specified was encrypted with aws/ebs of the target account.

Creating a Volume

I created a volume in the target account from the copy with CMK-A specified.

# Run in the target account
aws ec2 create-volume \
  --availability-zone ap-northeast-1a \
  --snapshot-id snap-0a1b2c3d4e5f67890 \
  --volume-type gp3

This is the result (excerpt) of checking the created volume with describe-volumes.

{
    "VolumeId": "vol-0b2c3d4e5f6a78901",
    "State": "available",
    "Encrypted": true,
    "KmsKeyId": "arn:aws:kms:ap-northeast-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
    "SnapshotId": "snap-0a1b2c3d4e5f67890"
}

Summary

Previously, snapshots encrypted with an AWS managed key could not be shared because that key cannot be used from another account. Since the key used for encryption cannot be changed, sharing required copying the snapshot in the source account with a CMK specified, to prepare a snapshot encrypted with a CMK.

With this update, you can later associate the CMK needed for sharing with the snapshot, so you can share it with another account without re-encrypting it.

If you use AWS managed keys for EBS encryption to avoid the cost and management burden of CMKs, and you need to share or copy snapshots to another account, please make use of this update.

Share this article

AWSのお困り事はクラスメソッドへ