fix: Ensure both ECS service definitions use the same settings/configurations #277
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.
This fixes the issue specifically with the
ignore_task_definition
service type.Description
This change ensures that ECS service tags are properly applied when using the
ignore_task_definition
service configuration. Previously, onlyvar.tags
were used, which causedvar.service_tags
to be ignored entirely for this resource.The following change was made:
Motivation and Context
Currently, when using
ignore_task_definition = true
, the ECS service resource does not receive any tags defined invar.service_tags
.There is no open issue for this, but the fix is straightforward and consistent with tagging patterns used elsewhere in the module.
Breaking Changes
No breaking changes.
How Has This Been Tested?
modules/service/main.tf
logic to correctly merge tags on my own terraform module, which references this module as its source. Service tags worked properly only after the change.terraform-aws-ecs/examples/fargate/main.tf
, changing only the following:in locals :
region = "us-east-1"
,in module "ecs_service": ignore_task_definition_changes = true,
I tested following the order/logic of the commits here https://github.com/will-abb/terraform-aws-ecs/tree/test-service-tags-not-progagated
pre-commit run -a
on my pull requestI get some formatting changes when I run the commit, but I think that's due to my local linux environment. But I could be wrong and can include the changes made by the pre-commit, but they appear to be just noise.