Skip to content

RDS Blue/Green Deployment fails on large DB with error: "IAM role used to create it was deleted"

0

Hi everyone,

We perform many Blue/Green deployments across our environments, but we recently ran into a persistent failure on a large PostgreSQL instance (around 6.6 TB) when creating the deployment via the AWS Console.

TARGET MODIFICATIONS:

  • Storage decrease: 6.6 TB to 5.1 TB
  • Storage type: gp2 to gp3
  • Engine version upgrade: PostgreSQL 16.13 to 16.15

EXECUTION BREAKDOWN: The deployment starts and completes the initial phases without issue: [SUCCESS] Read Replica creation of the source [SUCCESS] Scale storage [SUCCESS] Storage configuration upgrade

However, it fails at the final phase: [FAILED] DB engine version upgrade

ERROR MESSAGE: "Invalid configuration: RDS can't provision the Blue/Green Deployment because the IAM role used to create it was deleted. Delete the deployment, create it again with a valid IAM role, and ensure the role remains available throughout the deployment process. Delete and recreate your blue/green deployment , as well as the green database ."

LOG EVENT:

  • RDS can't provision the Blue/Green Deployment because the IAM role used to create it was deleted.

NOTES & OBSERVATIONS: No IAM roles, service-linked roles, or permissions were deleted, modified, or revoked by our team during this process. Because the database is very large (6.6 TB), the storage scaling phase takes a significant amount of time before the engine upgrade phase begins. We suspect there may be a timeout or session expiration bug in the RDS Blue/Green orchestrator that causes the service to drop or invalidate the temporary IAM role reference during long-running tasks.

Has anyone encountered this specific IAM error during long deployments, or is there a known workaround for large DBs (e.g., separating the storage scale from the engine upgrade into two distinct deployments)?

Thanks in advance for any insights!

  • If my answer was helpful, I would appreciate it if you could mark it as the accepted answer.

asked a month ago106 views

1 Answer
2

My understanding - root Cause: Under the hood, AWS RDS Blue/Green Deployments use asynchronous workflows running via temporary IAM session credentials (STS tokens). These assumed roles have a hard 12-hour expiration limit.

As noted in recent AWS engineering blogs, an RDS storage volume shrink is an extremely I/O-intense operation because it performs a physical data block copy to reconfigure the storage on the Green instance [cite: 1.1.3]. If you configure the Green instance to use gp3 without explicitly provisioning high throughput, it defaults to baseline speeds (often 125 MB/s to 250 MB/s). Copying roughly 6.6 TB at these speeds takes 14+ hours.

Because the storage phase takes so long, the 12-hour STS token expires. When the orchestrator finally attempts to trigger the last phase (the engine upgrade), the API call fails with the misleading error: "IAM role used to create it was deleted" because the temporary credentials no longer exist.

I would try the following workaround: You do not need to split the deployment or modify your live (Blue) instance. You simply need to accelerate the Green instance's block copy to beat the 12-hour orchestrator timeout.

  1. Deploy: Initiate your Blue/Green deployment as usual with all your desired targets in one go (6.6 TB -> 5.1 TB, gp2 -> gp3, 16.13 -> 16.15).
  2. Boost Target Throughput: In the deployment wizard's Storage section for the Green database, explicitly set the gp3 Provisioned Throughput to its maximum (e.g., 1,000 MB/s) and provision high IOPS (e.g., 10,000+ IOPS).
  3. Wait: With 1,000 MB/s throughput, the physical block copy for your dataset will complete in roughly 2 to 3 hours. This stays safely within the 12-hour STS lifespan, allowing the engine upgrade phase to trigger and complete successfully.
  4. Post-Switchover: After you have successfully switched over traffic to the Green instance, modify its storage settings to drop the Provisioned Throughput and IOPS back down to your normal baseline to optimize costs.

References:

EXPERT

answered a month ago

EXPERT

reviewed a month 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.