You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the new backend configs under the terraform {} block don't support interpolations, however as well as having a default backend config there is the ability to specify additional config during the terraform init with the -backend-config=path flag. This is great, but if you only want to define a single additional value, creating a separate file for it seems unnecessary. As an example, I'm using an S3 backend and want my S3 key to include the environment I'm deploying to. The S3 key is my only value that's different from the main backend config. To achieve this in the current setup, I'd have to create separate files for dev, test, production etc, with just the S3 key value in then run terraform init -backend-config=path/to/env/config. It'd be nice if there was a shorthand way to define these, maybe with environment variables or something e.g. TF_BACKEND_S3_KEY=somevalue
That way I could avoid littering my repo with additional config files and on deployments just set the env var to the value I want before running the init.
The text was updated successfully, but these errors were encountered:
Thanks! I appreciate backends are still in beta and I'm sure everyone has big ideas!
TBH I decided having separate configs per env wasn't such a bad idea and have gone with that for now. In general the whole backend concept is awesome and at my company we've been waiting a LONG time for this and had to get by with wrapper scripts all over the place to configure the remotes! So glad to see proper backends are finally here! 😃 I'll close this issue.
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.
ghost
locked and limited conversation to collaborators
Apr 16, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform v0.9.0-beta1 (4e96da5)
Currently, the new backend configs under the
terraform {}
block don't support interpolations, however as well as having a default backend config there is the ability to specify additional config during theterraform init
with the-backend-config=path
flag. This is great, but if you only want to define a single additional value, creating a separate file for it seems unnecessary. As an example, I'm using an S3 backend and want my S3 key to include the environment I'm deploying to. The S3 key is my only value that's different from the main backend config. To achieve this in the current setup, I'd have to create separate files for dev, test, production etc, with just the S3 key value in then runterraform init -backend-config=path/to/env/config
. It'd be nice if there was a shorthand way to define these, maybe with environment variables or something e.g.TF_BACKEND_S3_KEY=somevalue
That way I could avoid littering my repo with additional config files and on deployments just set the env var to the value I want before running the init.
The text was updated successfully, but these errors were encountered: