garden-io / garden

Automation for Kubernetes development and testing. Spin up production-like environments for development, testing, and CI on demand. Use the same configuration and workflows at every step of the process. Speed up your builds and test runs via shared result caching
https://garden.io
Mozilla Public License 2.0
3.33k stars 269 forks source link

[FEATURE]: Include generateFiles field in Deploy Actions. #4964

Open hassinerhouma opened 1 year ago

hassinerhouma commented 1 year ago

Feature Request

Re-include the generateFiles field into the Terraform (or all) deploy actions.

Background / Motivation

Garden currently offers no way of managing Terraform remote state backends.

While getting around this is very obvious for actions with a local source (include a backend.tf file in the sources), it is trickier with remote modules/actions. One easy workaround I found is using generateFiles to include a templated backend.tf file into the tf root of the terraform module. This way, I could generate the backend configuration and pass any needed variables or secrets to it.

Another use-case I stumbled upon was about extending remote Terraform modules. In my Garden config,I re-use the same modules that are used in production. Changing or extending them to accommodate my garden environments is not always straightforward, so I sometimes extend the modules by including more .tf files.

However, since the generateFiles field was removed in Actions, all of this is no longer possible and I am forced to stick with modules for now.

What should the user be able to do?

The user should be able to easily generate templated files (.tf files in this case) and include them in the Action sources.

Why do they want to do this? What problem does it solve?

Suggested Implementation(s)

The core logic is already there since this feature is still enabled for modules.

How important is this feature for you/your team?

🌵 Not having this feature makes using Garden painful

But as long as 0.14 is not there yet, and as long as we can keep using garden modules for Terraform, this is not a very pressing matter.

stefreak commented 10 months ago

@hassinerhouma Thank you for reporting this! Can you provide a minimal reproducable example?

Does this still happen with the latest version? I can imagine that https://github.com/garden-io/garden/pull/4846 impacted the behaviour here (without looking to closely at this yet).