-
Notifications
You must be signed in to change notification settings - Fork 31
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
Init vars escape issue #17
Comments
Thanks for reporting this, I'll take a look as soon as possible. |
Uhm, the problem here is that the specified backend args are not valid for the selected backend (local). I am pushing a test that actually runs init on a simple fixture, can you please try and break it, considering the only valid backend config k/v for local backends is |
Sorry, I haven't mentioned that my module use s3 backend terraform {
backend "s3" {}
} I've thought that there is something wrong with k value as it looks strange(with a single quote at the beginning).
This might be related to how either python/subprocess or shell interpret the combination of single and double quotes for result init command.
For example subprocess.run(['terraform', 'init', '-no-color', '-input=false', "-backend-config='bucket=bucket_name'", "-backend-config='key=
dummy.tfstate'", "-backend-config='region=us-east-1'"]) Output
If single quotes removed for backend-config it works as expected. subprocess.run(['terraform', 'init', '-no-color', '-input=false', "-backend-config=bucket=bucket_name", "-backend-config=key=dummy.tfstate", "-backend-config=region=us-east-1"]) |
Ah, now I understand what you mean. This is super strange as I'm not getting the same error, which puzzles me. Let me try to see what breaks if we remove the quotes. |
* add backend-config init test and fixture for #17 * remove extra file * add missing boilerplate to fixture * fix backend config quoting issue * bump version
Released as v1.5.4 can you test it and see if the issue is fixed? |
Thanks! |
Thank you for identifying the issue and suggesting the fix!!! |
Hello - looks like this is a bug when using gcs as the backend as well. I've had to remove the quotes. |
You mean we should reopen this? Can you provide a simple repro? |
When backend-config is passed to a subprocess with init_vars it is not properly escaped.
Example
Output
The text was updated successfully, but these errors were encountered: