Skip to content

Has anyone got RDS Blue/Green TargetKmsKeyId working?

1

The RDS docs describe a new Blue/Green option that creates an encrypted green environment from an unencrypted DB instance: TargetKmsKeyId inside TargetResourceConfigurations (User Guide, "Encrypting the green environment").

On a fresh test instance it fails right away:

An error occurred (InvalidParameterCombination) when calling the CreateBlueGreenDeployment operation: The input parameter TargetResourceConfigurations is not supported.
aws rds create-blue-green-deployment \
  --blue-green-deployment-name test-bg \
  --source <instance ARN> \
  --target-resource-configurations '[{"SourceArn":"<instance ARN>","TargetKmsKeyId":"alias/aws/rds"}]'

Same result on MySQL and MariaDB test instances. Is this option available yet, or does it need something the docs don't mention?

asked a month ago338 views

3 Answers
1

+1

Been trying to get this working today on Aurora PostgreSQL on us-east-1 and does not work. Get the same error reported here. I'm also trying to migrate my DB into an encrypted cluster.

answered 15 days ago

  • I've also been trying to get this to work in us-east-1 with no luck. Same error.

1

I haven't tried this myself yet, but indeed the feature is documented, but as far as I understand there is no "What's New" announcement for it yet, so it may not be rolled out in every Region.

My understanding what the docs day:

  • The RDS User Guide lists "Encrypting the green environment" under Blue/Green considerations: set TargetKmsKeyId per source DB instance in TargetResourceConfigurations. The key must exist, be enabled, and you need permission to use it. Unencrypted read replicas need their own entry. First link.
  • The API reference describes TargetResourceConfiguration the same way (SourceArn required, TargetKmsKeyId for an unencrypted source or a key change). Second link herubder.

Your CLI accepted the parameter and the error came back from the RDS API, so this isn't a syntax problem on your side. The service endpoint you called rejected the parameter. Until recently AWS said this wasn't possible at all (see "Options for changing AWS KMS encryption key for Amazon RDS databases" on the AWS Database Blog - last link herunder), so it's a new capability.

I would open an support request and ask whether TargetResourceConfigurations is enabled in your Region. Meanwhile, the established path still works: snapshot → copy with encryption → restore, or one of the low-downtime options the last link:

PS: Quick sanity check: You could try running the exact same CLI command against ⁠us-east-1⁠. New API features almost always deploy there first — if it works in Virginia but fails in your region, it confirms a regional rollout lag.

EXPERT

answered a month ago

AWS
SUPPORT ENGINEER

reviewed a month ago

0

Adding to Florian's answer with the low-downtime path that works today for MySQL and MariaDB, since the docs-only feature still fails for several people (including us-east-1 per the comments).

Check if your Region accepts it yet (cheap, no resources created if it fails):

aws rds create-blue-green-deployment \
  --blue-green-deployment-name kms-probe \
  --source <instance ARN> \
  --target-resource-configurations '[{"SourceArn":"<instance ARN>","TargetKmsKeyId":"<key ARN>"}]' \
  --region <region>

Use the key ARN rather than the alias, and make sure you are on a recent CLI. If it still returns InvalidParameterCombination ... not supported, the API endpoint has not enabled it; nothing on your side will change that.

What works now: encrypted copy of a paused replica + binlog replication

  1. On the unencrypted source, keep binlogs long enough for the whole procedure: CALL mysql.rds_set_configuration('binlog retention hours', 48);
  2. Create a read replica of the source. When it has caught up, stop replication on it (CALL mysql.rds_stop_replication;) and record Relay_Source_Log_File and Exec_Source_Log_Pos from SHOW REPLICA STATUS. That is the exact position your copy will start from.
  3. Snapshot the paused replica, copy the snapshot with --kms-key-id, and restore the encrypted copy as a new instance. Delete the temporary replica afterwards.
  4. On the new encrypted instance, point it at the source with the recorded file and position: CALL mysql.rds_set_external_source(...), then CALL mysql.rds_start_replication;
  5. When Seconds_Behind_Source is 0, stop writes on the source, wait for the replica to catch up, stop replication with CALL mysql.rds_reset_external_source;, and move the application (swap the DNS name, or rename the instances).

Downtime is the cutover only, usually a few minutes. Two common pitfalls: the replication user needs replication privileges on the source and the security group must allow the new instance to reach it; and any read replicas need to be recreated from the new encrypted primary.

For Aurora PostgreSQL (the +1 comment), the equivalent is restoring an encrypted snapshot and using logical replication (publication on the old cluster, subscription on the new one) or DMS CDC to catch up before cutover.

answered 3 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.