Feature Request: Support passing terraform CLI flags during sam build
tam116 opened this issue · 1 comments
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
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.