Managing ECS Revisions with Terraform and CodeDeploy

Viewed 120

I use Terraform to manage infrastructure and CodeDeploy to rollout the ECS service. I'm wondering if there's a best practice on preventing Terraform from incrementing the version of revision of the ECS image in order to allow CodeDeploy to roll out changes.

I believe if I terraform apply it will apply the revision immediately that the service is using, correct? I would like to have CodeDeploy manage the rollout of the service but also keep Terraform to manage infrastructure.

Edit

I'm wondering if the best use case would be to use something like: https://www.terraform.io/docs/language/meta-arguments/lifecycle.html and bypass version changes

Example:

  lifecycle {
    ignore_changes = [task_definition]
  }
0 Answers
Related