Skip to content

fix: Ensure both ECS service definitions use the same settings/configurations #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

will-abb
Copy link
Contributor

@will-abb will-abb commented Apr 18, 2025

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, only var.tags were used, which caused var.service_tags to be ignored entirely for this resource.

The following change was made:

- tags = var.tags
+ tags = merge(var.tags, var.service_tags)

Motivation and Context

Currently, when using ignore_task_definition = true, the ECS service resource does not receive any tags defined in var.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?

  • I tested and validated it by updating the 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.
  • I have also tested and validated using the provided example in 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
  • I have executed pre-commit run -a on my pull request
    I 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.

This fixes the issue specifically with the `ignore_task_definition` service type.
@will-abb will-abb changed the title fix: ensure ECS service tags are propagated fix: Ensure ECS service tags are propagated Apr 18, 2025
@bryantbiggs bryantbiggs changed the title fix: Ensure ECS service tags are propagated fix: Ensure both ECS service definitions use the same settings/configurations Apr 18, 2025
@bryantbiggs bryantbiggs merged commit 6f4feab into terraform-aws-modules:master Apr 18, 2025
12 checks passed
antonbabenko pushed a commit that referenced this pull request Apr 18, 2025
## [5.12.1](v5.12.0...v5.12.1) (2025-04-18)

### Bug Fixes

* Ensure both ECS service definitions use the same settings/configurations ([#277](#277)) ([6f4feab](6f4feab))
@antonbabenko
Copy link
Member

This PR is included in version 5.12.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants