[853] Use live data for ECS task definitions for service pinning #876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello card URL:
https://trello.com/c/nlsIBurV/853-fix-issue-with-terraform-ecs-task-pinning
Changes in this PR:
Terraform
data
resources fetch the current state of the live system, rather than relying on the Terraform state. This means we can create new task definitions outside of Terraform and have itpick them up in a plan. Our build and deploy process does this, which was causing an issue where
terraform apply
s were rolling back to earlier versions if there was no change to the task definition.After merging this, we should never see changes to the
task_definition
formodule.ecs.aws_ecs_service.*
unless we're changing the connected task definition in the same change.This may cause issues on a fresh system deployment, as there is no matching task definition at that point.
hashicorp/terraform#16380 (comment)
Next steps: