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

Terraform Orb - Allow multiple var_file parameters #107

Closed
steinybot opened this issue Mar 17, 2020 · 3 comments
Closed

Terraform Orb - Allow multiple var_file parameters #107

steinybot opened this issue Mar 17, 2020 · 3 comments

Comments

@steinybot
Copy link

Terraform permits passing multiple -var-file parameters and so the orb should too:

❯ terraform plan -var-file=cicd.tfvars -var-file=terraform.tfvars
Refreshing Terraform state in-memory prior to plan...

This is related to #106 in that either that issue or this issue is required in order to overcome the limitation in hashicorp/terraform#16197.

@steinybot steinybot changed the title Allow multiple var_file parameters Terraform Orb - Allow multiple var_file parameters Mar 17, 2020
@danielflookovo
Copy link
Contributor

CircleCI doesn't support passing multiple parameters with the same name, they are restricted by the YAML format in that respect.

You can achieve this in the Terraform Orb by passing a single var_file (or var/backend_config/backend_config_file) with a comma separated value. e.g.:

jobs:
  terraform_plan:
    executor: terraform/terraform-0_12
    steps:
    - checkout
    - terraform/plan:
        path: terraform/deployments/cluster
        workspace: gauges-uat
        var_file: env/nonprod.tfvars,env/common.tfvars

@steinybot
Copy link
Author

Apologies, I should have read the docs more carefully:

var_file (string): Comma separater list of terraform var files

@steinybot
Copy link
Author

In case anyone is interested here is the CircleCI feature request to add list/array parameters https://ideas.circleci.com/ideas/CCI-I-701.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants