AWS Builder Center

The KMS Key Is Why Your Cross-Account RDS Snapshot Copy Keeps Failing

The KMS Key Is Why Your Cross-Account RDS Snapshot Copy Keeps Failing

The KMS Key Is Why Your Cross-Account RDS Snapshot Copy Keeps Failing

For DBAs and platform engineers who need to move an encrypted RDS snapshot into another AWS account or Region and keep running into a wall that looks like a permissions bug.
The first time I built a cross-account database refresh, I budgeted an afternoon. Production lived in one account, the non-production estate lived in another, and the ask was simple enough to fit in a sentence: take last night's snapshot, land it in the other account, stand up a copy for the application team. I had the IAM trust policy worked out, the snapshot was right there in the console, and I had done the same thing a hundred times inside a single account.
It failed. Not loudly, which is the part that cost me the afternoon. Sharing the snapshot appeared to succeed. The target account could see it. And then the restore refused, and the error that eventually surfaced was  KMSKeyNotAccessibleFault , which reads like an IAM problem and sends you straight to the wrong place. I spent two hours widening IAM policies that were never the issue.
The actual problem was that the snapshot was encrypted with the default RDS KMS key, and that key cannot leave the account. Not "is hard to share." Cannot be shared, by design, with no policy you can write to change it.

Why this matters

Encryption at rest on RDS is close to universal now, either by policy or by habit. If you take the default when you create an instance, RDS encrypts it with the AWS managed key for RDS, the one that shows up as  aws/rds . That key is convenient right up until the moment you need the data somewhere else.
AWS managed keys have no editable key policy. You cannot add another account as a grantee, which means any snapshot encrypted with one is permanently stuck in its home account. The AWS documentation puts it in six words: "Snapshots that have been encrypted with the default AWS KMS key can't be shared."
This is one of those decisions you make on day one, in a create-instance wizard, without knowing you are making it. Three years later someone asks for a cross-account refresh pipeline and the answer is that every snapshot you own has to be re-encrypted first.

How the copy actually has to work

Four steps, and the order matters.
Step one: re-encrypt into a customer managed key. If the snapshot is encrypted with  aws/rds , copy it to itself inside the source account and specify a customer managed key as the target. This is the step people skip.
aws rds copy-db-snapshot \
--source-db-snapshot-identifier prod-db-snapshot-20261005 \
--target-db-snapshot-identifier prod-db-snapshot-20261005-cmk \
--kms-key-id arn:aws:kms:us-east-1:111122223333:key/abcd1234-a123-456a-a12b-a123b4cd56ef
Your customer managed key's key policy needs to grant the target account access, and the calling principal needs a specific set of KMS actions. The documented set is  kms:DescribeKey ,  kms:CreateGrant ,  kms:Decrypt ,  kms:Encrypt ,  kms:GenerateDataKey ,  kms:GenerateDataKeyWithoutPlaintext , and  kms:ReEncrypt . If you have IAM policy conditions restricting KMS grant operations, this is exactly where  KMSKeyNotAccessibleFault  comes from.
Step two: share the re-encrypted snapshot. Sharing is a snapshot attribute, not a resource policy:
aws rds modify-db-snapshot-attribute \
--db-snapshot-identifier prod-db-snapshot-20261005-cmk \
--attribute-name restore \
--values-to-add 444455556666
The attribute name is always  restore . You can share a manual snapshot with up to 20 other AWS accounts, and passing  all  makes it public, which you almost certainly do not want for a database snapshot.
Step three: in the target account, copy before you restore. Here is the second trap, and it catches people who got past the first one. A snapshot that is both shared and encrypted cannot be restored directly. The documentation is explicit: "you can't restore a DB instance from a DB snapshot that is both shared and encrypted. Instead, you can make a copy of the DB snapshot and restore the DB instance from the copy."
So from the target account, copy the shared snapshot into a key that account owns:
aws rds copy-db-snapshot \
--source-db-snapshot-identifier arn:aws:rds:us-east-1:111122223333:snapshot:prod-db-snapshot-20261005-cmk \
--target-db-snapshot-identifier refresh-source-20261005 \
--kms-key-id arn:aws:kms:us-east-1:444455556666:key/wxyz5678-b456-789b-b45c-b456c7de89fa
When you copy an encrypted snapshot shared from another account, the  --kms-key-id  parameter is required. It is not optional and it does not default to anything sensible.
Step four: restore from your own copy. Now the normal  restore-db-snapshot  path works.

Where this requires care

Cross-Region adds a hard constraint. Copying across Regions means specifying a KMS key that is valid in the destination Region, either a Region-specific key or a multi-Region key. And if you are trying to do cross-Region and cross-account in one action, you have to share the snapshot with the target account first, and share the KMS key with it too. Note also that a shared snapshot can be copied across Regions only if it is unencrypted, which rules out the one-hop shortcut for most production data.
There are concurrency limits, and they bite during bulk work. You can copy up to 20 DB snapshots at a time from one Region to another per account, and you can have up to 20 cross-Region copy requests in progress to a single destination Region per account. Multiple copies from the same source instance are queued internally, so the later ones do not start until the earlier ones finish. If you wrote a loop that fires off 60 copies and assumed they run in parallel, your wall-clock estimate is wrong.
Parameter groups do not come along. When you copy a snapshot across Regions, the copy does not include the parameter group from the original instance. Restore it and you get the default parameter group for that Region. I have watched a "why is the refreshed database slower" investigation end at exactly this, after someone spent a day on query plans. Recreate the parameter group in the destination Region first, then apply it with a modify after the restore.
Option groups are Region-scoped too. If your source instance uses a nondefault option group, pass  --option-group-name  when copying across Regions. If the source uses Transparent Data Encryption for Oracle or SQL Server, this is mandatory, not advisory.
Tags are opt-in. Pass  --copy-tags  or your cost allocation reporting quietly develops a hole.

Quick reference

  • Snapshots encrypted with the default  aws/rds  key cannot be shared, full stop. Re-encrypt into a customer managed key first.
  • Sharing is  modify-db-snapshot-attribute --attribute-name restore --values-to-add <account-id> , up to 20 accounts.
  • A snapshot that is both shared and encrypted cannot be restored directly. The target account must copy it first, and must pass  --kms-key-id  on that copy.
  • Cross-Region copies need a key valid in the destination Region, and cross-Region copy of a shared snapshot works only when the snapshot is unencrypted.
  • 20 concurrent cross-Region copies per account; copies from the same source instance queue up rather than running in parallel.
  • Parameter groups and nondefault option groups do not travel with a cross-Region copy. Recreate them in the destination first.
  • Pass  --copy-tags  explicitly.

My take

If you are building anything resembling a refresh pipeline, stop defaulting to the AWS managed key. Create a customer managed key for your database estate on day one, give it a key policy that already anticipates the accounts you will eventually share with, and use it everywhere. The incremental cost of a customer managed key is trivial next to the cost of discovering, mid-project, that every snapshot you own needs a re-encryption pass before it can move.
The deeper lesson is that  KMSKeyNotAccessibleFault  is one of the worse-named errors in RDS. It sounds like your IAM policy is short an action. Sometimes it is. But often it means the key in question is architecturally incapable of being accessed from where you are standing, and no amount of policy editing will fix it. When you see that error on a cross-account operation, check which key encrypted the snapshot before you touch a single IAM policy.

Further reading

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article