-
This is a question we got from a customer. I'll share our recommendation below. How can I use Terraform to do blue/green deployments, rolling deployments, and canary deployments? How would I integrate this sort of thing into my CI / CD pipelines? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As discussed in How to use Terraform as a Team, Terraform does not have support built into the language or its standard workflows for deployment strategies such as blue/green deployment, rolling deployment, or canary deployments. However, depending on what you're deploying, there are several ways to accomplish these deployment strategies: Option 1: deployment strategies built into specific resources/servicesSome of the services that you manage with Terraform may natively support various deployment strategies if you configure the corresponding Terraform resources correctly. Here are a few examples:
Option 2: implement deployment strategies in custom scriptsNot all Terraform resources have built-in deployment strategies (in fact, most don't) or if they have them, they might not support the deployment strategy you want. In some cases, there's nothing you can do about it: e.g., you can't really do a blue/green deployment for a VPC route table update; either you update it, or you don't. For some resources, you can implement the deployment strategy yourself using custom scripts. Here are a few examples:
Option 3: use tools other than TerraformWhile Terraform is a great fit for managing your infrastructure, for managing the apps that run on top of that infrastructure, dedicated tools can sometimes be a better fit.
|
Beta Was this translation helpful? Give feedback.
As discussed in How to use Terraform as a Team, Terraform does not have support built into the language or its standard workflows for deployment strategies such as blue/green deployment, rolling deployment, or canary deployments. However, depending on what you're deploying, there are several ways to accomplish these deployment strategies:
Option 1: deployment strategies built into specific resources/services
Some of the services that you manage with Terraform may natively support various deployment strategies if you configure the corresponding Terraform resources correctly. Here are a few examples:
Deployment
object…