In order to take advantage of AWS's integrated CodeDeploy application supporting blue-green deployments we need to implement a multi-stage deployment process. Deployment proceeds as follows
- Update the Terraform configuration
- In most cases this will mean just updating the docker-image tag, which can be done with a command-line variable argument (e.g. without any file changes)
- Apply terraform configuration
- This should always happen in a two staged approach of using
terraform plan -out=<file_path>and verifying the plan before callingterraform apply <file_path>
- This should always happen in a two staged approach of using
- Copy the s3_uri variable that is generated as output from running terraform apply
- Start a CodeDeploy deployment referencing the s3_uri as appspec.yaml file