- Newest
- Most votes
- Most comments
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.
- 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).
- Boost Target Throughput: In the deployment wizard's Storage section for the Green database, explicitly set the
gp3Provisioned Throughput to its maximum (e.g., 1,000 MB/s) and provision high IOPS (e.g., 10,000+ IOPS). - 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.
- 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:
- AWS Database Blog: Shrink storage volumes for your RDS databases (See section: "Improve performance with higher gp3 throughput") - It explicitly states that "the underlying storage performance of the green instance plays a critical role in the completion time" of shrink operations [cite: 1.1.3]. -> https://aws.amazon.com/blogs/database/shrink-storage-volumes-for-your-rds-databases-and-optimize-your-infrastructure-costs/
Relevant content
asked 2 years ago

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