Associated KMS keys
An associated KMS key is an additional customer managed KMS key that you associate with an encrypted snapshot. A principal with access to the associated KMS key can access the snapshot's data for cross-account sharing and copying, without being granted access to the existing KMS key that encrypts the snapshot. The associated KMS key does not replace or change the existing KMS key that encrypts the snapshot, it does not grant access to that key, and associating it does not re-encrypt the snapshot's data.
When an Amazon EBS snapshot is encrypted, it's protected by a single AWS KMS key, and only those with access to that key can access the snapshot's data or copy the snapshot to another account. If the snapshot is encrypted under an AWS managed key, you can't share it with or copy it to another account, because an AWS managed key's key policy can't be modified to grant access to another account.
Associated KMS keys help you share an encrypted snapshot with another AWS account without granting access to the existing KMS key that encrypts the snapshot — for example, for cross-account backup, disaster recovery, or compliance. You can associate a KMS key that you also share with the other account, and the other account can then copy the snapshot using the associated KMS key. This also enables you to share snapshots encrypted with an AWS managed key, which otherwise can't be shared across accounts.
To use an associated KMS key across accounts, both of the following must be true:
-
The associated KMS key's key policy must allow the other account's principal to use the key.
-
That principal's IAM policy in their own account must allow them to use the associated KMS key.
Granting one without the other is not sufficient. For more information, see How AWS KMS evaluates access to a KMS key in the AWS Key Management Service Developer Guide.
Associate or disassociate a KMS key
You can associate a customer managed key with an encrypted snapshot, disassociate a KMS key from a snapshot, or view the KMS keys associated with a snapshot, using one of the following methods.
Considerations
-
You can associate a KMS key only with an encrypted snapshot.
-
The associated KMS key must be a customer managed key. You can't associate an AWS managed key.
-
You can't associate a KMS key that the snapshot already uses, whether it's the existing KMS key that encrypts the snapshot or a KMS key that's already associated with the snapshot.
-
You can't associate a KMS key with a snapshot in the Archive tier.
-
To create a volume from an encrypted snapshot, you must have access to the existing KMS key that encrypts the snapshot.
-
You can associate a KMS key with Local snapshots and regional snapshots in Local Zones, and with Amazon EBS Local snapshots on Outposts.
Permissions
To associate or disassociate a KMS key, you need the
ec2:AssociateKmsKeyId and ec2:DisassociateKmsKeyId IAM
permissions, plus the AWS KMS permissions that Amazon EBS requires to use a KMS key. For
the full set of required AWS KMS permissions, see Requirements for Amazon EBS encryption.
Troubleshooting
If an associate, disassociate, or copy request fails with an authorization error, the error identifies the KMS key or keys that you're not authorized to use. Make sure you have permission to use that key — both the key's policy and your IAM policy must allow it. To see which KMS key a request used, review your CloudTrail event history.