-
Notifications
You must be signed in to change notification settings - Fork 273
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
[FEATURE]: Terraform workspace support #2024
Comments
@Pacobart I also ran into this issue and resolved it this way:
Based on the recommendation here: https://support.hashicorp.com/hc/en-us/articles/360043550953-Selecting-a-workspace-when-running-Terraform-in-automation This satisfies my goal, of having a user install just garden, pull down a repo, and run garden deploy... with out having to manage, kubectl, terraform, etc dependencies... this all said... first class support for workspaces would be good, and is still a valid feature... and you may end up implementing it in a similar way by managing the .terrform/environment file directly... |
As discussed in this thread: https://kubernetes.slack.com/archives/CKM7CP8P9/p1598982704073300 There are some inconsistencies with how the terraform backends works with workspaces. In the case of S3 there is a default workspace named The way we git around this in our other pipelines is
This passes an input value to the backend to select the 1st workspace which is default for the init Example:
With our work around
but because TF_WORKSPACE is set... a show will indicated that it has been overridden:
Because of this difference, it might be necessary to ensure that garden knows the type of backend used, whether via a scan and pulling it automagically, or having the user set a field value. But in the case of S3 it is possible to run the init command with the default setting, and then create the If garden wanted to handle this issue and support the TF_WORKSPACE variable... they could have a field
|
@edvald FYI |
This issue has been automatically marked as stale because it hasn't had any activity in 60 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product! |
@edvald We still believe this is a needed feature and aligns with the strategy of Terraform being a first class citizen in Garden. |
Agreed! Stalebot being a little over-eager there. |
You can now set the `workspace` field on the Terraform provider as well as on `terraform` modules. When set, Garden will select (creating if necessary) the specified Terraform workspace ahead of applying, planning, destroying etc. Closes #2024
You can now set the `workspace` field on the Terraform provider as well as on `terraform` modules. When set, Garden will select (creating if necessary) the specified Terraform workspace ahead of applying, planning, destroying etc. Closes #2024
You can now set the `workspace` field on the Terraform provider as well as on `terraform` modules. When set, Garden will select (creating if necessary) the specified Terraform workspace ahead of applying, planning, destroying etc. Closes #2024
Feature Request
Background / Motivation
We use terraform workspaces to manage state across multiple deployment environments. Currently, this requires running a custom
exec
module with the commands to create/select workspaces.What should the user be able to do?
In the terraform module allow setting the workspace name statically or via variable.
Why do they want to do this? What problem does it solve?
When using the
exec
module the commands don't always run as intended causing us to manually run commands prior to usinggarden
commands. This feature also aligns with terraform being a first class citizen in garden.Suggested Implementation(s)
How important is this feature for you/your team?
🌵 Not having this feature makes using Garden painful
The text was updated successfully, but these errors were encountered: