aws-cloudformation / aws-cloudformation-resource-providers-rds

The CloudFormation Resource Provider Package For Amazon Relational Database Service
https://aws.amazon.com/rds/
Apache License 2.0
27 stars 43 forks source link

[BlueGreenDeployment] Create AWS::RDS::BlueGreenDeployment resource #443

Closed osdrv closed 10 months ago

osdrv commented 1 year ago

This PR implements a new resource called AWS::RDS::BlueGreenDeployment.

Blue/Green deployment functionality provides a staging sandbox customer environment that would operate as a read replica to the original database instance. A DNS-based switch would ensure a zero-downtime flipover once the new instance is confirmed to be operating correctly.

BlueGreenDeployment resource is create-only: given that the corresponding RDS representation of a deployment does not support a modify operation, CFN would favor a resource replacement upon an attribute mutation.

The current implementation introduces a couple of ephemeral attributes that do not exist in the RDS representation but are vital for a granular resource management in CFN.

Stage: a new BlueGreenDeployment is expected to be created in a blue stage. This is the initial stage of its lifecycle. A complete clone of the current setup would be created at this stage and configured as a read-replica. Upon a graduation moment, the stage is expected to be flipped to green: this would indicate that the automation needs to perform a switchover and complete the instance upgrade.

DeleteSource: at the moment, BlueGreenDeployment exposes the DeleteTarget flag that would take care of the target instance cleanup if the BlueGreenDeployment was never completed. It won't clean up the source instance once the switch is over though. This flag adds an additional control over the source instance and would ensure to clean it up upon a BlueGreenDeplpoyment resource removal.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.