terraform-aws-ecs
terraform-aws-ecs copied to clipboard
feat: Allow disabling service creation to support creating just a task definition
Description
The new create_service_resource variable controls whether a service resource should be created (which is true by default) allowing skipping creation of the service when it's not required.
Motivation and Context
- Resolves #162
Breaking Changes
No breaking changes were introduced in the PR.
How Has This Been Tested?
- [ ] I have updated at least one of the
examples/*to demonstrate and validate my change(s) - [ ] I have tested and validated these changes using one or more of the provided
examples/*projects
- [ ] I have executed
pre-commit run -aon my pull request
@bryantbiggs, sure, I've added an example in the last commit. In this case I haven't tested the example as I don't have a sandbox account I can play around easily with it at the moment, though tf plan shows exactly what I'd expect β cluster + task definition + all supporting resources, without service and autoscaling groups, LBs, etc. Would that be enough for you to test it out and see it this helps? In the meantime, I will apply the proposed change in the development stage over our own resources tomorrow and see how it works for a real use case.
Getting back to you with an update: the fix worked for our case β an ECS cluster + a standalone task definition for it. Works as expected. We're going to use the branch until it's implemented as a part of the official module. @bryantbiggs waiting for your feedback regarding the example I provided. I'm happy to complete the rest of the change-related routines if you confirm that the solution is aligned with the whole module concept π
Thanks for the review and sorry for the silence β I've been feeling unwell. Will try to push the necessary changes today π
@bryantbiggs all checks are now passed, though I haven't tested the Fargate example on a real account. Could you please help out with this? I still don't have a spare sandbox for testing out open-source tools. However, I tested the change in the branch on our dev-account over the resource we configured last week using the proposed change β it still works there.
I'll test this tonight/early tomorrow - there are a few minor tweaks we'll need to make, if you enable us to contribute to your PR we can push them directly here, otherwise I'll cut a PR against your PR (meta!)
Thanks! Sure, I've added you to our fork β feel free to modify the branch of this PR
This PR is included in version 5.10.0 :tada:
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.