Skip to content
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

Support for scheduled tasks/standalone task definitions and container definitions #162

Closed
kaarejoergensen opened this issue Feb 8, 2024 · 7 comments · Fixed by #176
Closed
Milestone

Comments

@kaarejoergensen
Copy link

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.

@antonbabenko
Copy link
Member

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.

@filip5114
Copy link

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.

@lancedikson
Copy link
Contributor

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

@bryantbiggs bryantbiggs added this to the v6.0.0 milestone Feb 23, 2024
@filip5114
Copy link

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

@lancedikson
Copy link
Contributor

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?

bryantbiggs added a commit that referenced this issue Mar 12, 2024
…k definition (#176)

* feat: added create_service variable support

Addressing the issue #162
#162

The new create_service_resource variable controls whether a `service` resource should be created (which is `true` by default), but still allows skipping creation of the service when it's not required.

* chore: Update example, add output for task definition family and revision

---------

Co-authored-by: Bryant Biggs <[email protected]>
antonbabenko pushed a commit that referenced this issue Mar 12, 2024
## [5.10.0](v5.9.3...v5.10.0) (2024-03-12)

### Features

* Allow disabling service creation to support creating just a task definition ([#176](#176)) ([94c992a](94c992a)), closes [#162](#162)
@antonbabenko
Copy link
Member

This issue has been resolved in version 5.10.0 🎉

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants