terraform-aws-modules/terraform-aws-ecs

Support for scheduled tasks/standalone task definitions and container definitions

Closed this issue · 7 comments

Is your request related to a problem? Please describe.

I would like to be able to create scheduled tasks using this module, but I find it a bit cumbersome to create task definitions without creating a corresponding service. I would like to be able to use the EventBridge module in conjunction with this module.

Describe the solution you'd like.

I'd like to be able to create task definitions using this module, without creating a service. If the task definition could be moved to it's own sub-module, this module could be used.

Describe alternatives you've considered.

Right now I'm writing my own module by using the EventBridge module, and the aws_task_definition ressource.

Thank you in advance.

Thanks for opening this issue. I think you can create aws_ecs_task_definition resources by controlling create_task_definition = true variables to turn on the creation only for task definition, while disabling the rest of the service-module resources if you use a submodule in modules/service:

https://github.com/terraform-aws-modules/terraform-aws-ecs/blob/master/modules/service/main.tf#L611

PS: I didn't try to do it. Just saying.

If you want to disable service creation you need to set create = false and create_task_definition depends on var.create.
Currently I don't see a way to create only task definition.

Hi guys! I stumbled upon the same problem now. Did you accomplish the goal with this module, or did you write your own module for such cases? @filip5114 @kaarejoergensen

Own module. Basically, I have cloned this module and removed everything except task definition and container definitions.

Hi guys! I see @bryantbiggs tagged the issue as a v6 milestone target, though I needed to find a solution faster, so I introduced a simple separate switcher for the service resource, and this fix seems to be working for our case. @bryantbiggs do you think this is a fix we could consider for merging soon? I haven't checked the required PR-related checkpoints, such as testing the change over the examples, as I wanted to align with the maintainers on the applicability of the fix in general. Does this feature from your POV make sense?

This issue has been resolved in version 5.10.0 🎉

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.