Skip to content
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 Request: Support passing terraform CLI flags during sam build #4439

Open
tam116 opened this issue Nov 23, 2022 · 2 comments
Open

Feature Request: Support passing terraform CLI flags during sam build #4439

tam116 opened this issue Nov 23, 2022 · 2 comments
Labels
area/terraform terraform support issue stage/pm-review Waiting for review by our Product Manager, please don't work on this yet type/feature Feature request

Comments

@tam116
Copy link
Contributor

tam116 commented Nov 23, 2022

Currently the calls to terraform use a hardcoded set of flags. There are some use cases where passing additional flags would be helpful, such as the -var/-var-file flags to provide different variables depending on the environment being targeted.

These extra flags could be specified in the samconfig.toml as tf_extra_args or something like that

@tam116 tam116 changed the title Support passing terraform CLI flags during sam build Feature Request: Support passing terraform CLI flags during sam build Nov 23, 2022
@moelasmar moelasmar added the area/terraform terraform support issue label Nov 23, 2022
@moelasmar
Copy link
Contributor

moelasmar commented Nov 23, 2022

Thanks @tam116 for raising this feature request. We already have a task on our backlog for this request.
For the beta feature scope, we recommend using the Terraform environment variables https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_var_name to pass the terraform variables used in your terraform project, and also to use this https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_cli_args-and-tf_cli_args_name to pass any other terraform command options/flags

Could you please try using SAM CLI with these environment variables, and let us know if you face any issues.

We will update this issue when we start working on supporting these options within SAM CLI arguments/options.

@colton-herrod-bayer
Copy link

Is this now enabled with the addition of the TF_ENVIRONMENT_VARIABLE options?

I've been able to pass variable file flags setting those environment variables, but there's no mention of them in the documentation so I'm unclear if that's their intended use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/terraform terraform support issue stage/pm-review Waiting for review by our Product Manager, please don't work on this yet type/feature Feature request
Projects
None yet
Development

No branches or pull requests

3 participants