terraform-aws-ecs icon indicating copy to clipboard operation
terraform-aws-ecs copied to clipboard

feat: Allow disabling service creation to support creating just a task definition

Open lancedikson opened this issue 1 year ago β€’ 2 comments

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 -a on my pull request

lancedikson avatar Mar 03 '24 09:03 lancedikson

@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.

lancedikson avatar Mar 03 '24 16:03 lancedikson

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 πŸ™

lancedikson avatar Mar 04 '24 12:03 lancedikson

Thanks for the review and sorry for the silence β€” I've been feeling unwell. Will try to push the necessary changes today πŸ‘Œ

lancedikson avatar Mar 10 '24 09:03 lancedikson

@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.

lancedikson avatar Mar 10 '24 15:03 lancedikson

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!)

bryantbiggs avatar Mar 11 '24 21:03 bryantbiggs

Thanks! Sure, I've added you to our fork β€” feel free to modify the branch of this PR

lancedikson avatar Mar 11 '24 22:03 lancedikson

This PR is included in version 5.10.0 :tada:

antonbabenko avatar Mar 12 '24 00:03 antonbabenko

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.

github-actions[bot] avatar Apr 13 '24 01:04 github-actions[bot]