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

Overwrite tfvar files doesn't work properly #120

Closed
eistrati opened this issue Jan 19, 2018 · 6 comments
Closed

Overwrite tfvar files doesn't work properly #120

eistrati opened this issue Jan 19, 2018 · 6 comments
Assignees
Labels

Comments

@eistrati
Copy link
Contributor

eistrati commented Jan 19, 2018

I have the following setup:

  1. In .recink.yml
your_tf_script_name:
  root: './your_tf_script_path'
  terraform:
    plan: true
    apply: false
    destroy: false
    var-files:
      - prod.tfvars
      - common1.tfvars
      - common2.tfvars
...
  1. In CLI
recink run terraform -vv \
  --tf-varfiles="dev.tfvars,common.tfvars"

Expected result: apply values from dev.tfvars and common.tfvars
Actual result: apply values from dev.tfvars, common.tfvars and common2.tfvars

@avozicov
Copy link
Contributor

avozicov commented Feb 1, 2018

Test Failed

I am facing the following error when running recink run terraform with --tf-vars options
Cannot read property 'trim' of undefined

Please refer to attachment for more details:
screen shot 2018-02-01 at 16 06 06

@avozicov
Copy link
Contributor

avozicov commented Feb 5, 2018

I would suggest a minor improvement for the following use case:

  • when using custom terraform config with defined var-files it is expected to perform validation for variables content and in case if it is empty return a notification message in console

Actual result:

  • case when custom config variables are empty terraform process froze without any debug information

@ddimitrioglo
Copy link
Contributor

ddimitrioglo commented Feb 7, 2018

@avozicov Fixed in #136. Now --var-files="" or --var-files=" " will be skipped

@ddimitrioglo
Copy link
Contributor

ddimitrioglo commented Feb 12, 2018

@avozicov FYI. The main requirements for all the FT parameters were described here:

Clarification:
1. --tf-workspace="dev" <==> --custom-config="your_tf_script_name.terraform.current-workspace:dev"
2. --tf-version="0.11.0" <==> --custom-config="$.terraform.version:0.11.0"
3. --include-modules or --exclude-modules && --tf-version="0.11.0" <==> --custom-config="module1.terraform.version:0.11.0,module2.terraform.version:0.11.0,..."
4. --tf-varfiles="v0,v1,..." <==> --custom-config="$.terraform.var-files.0:v0,$.terraform.var-files.1:v1,..."
5. --include-modules or --exclude-modules && --tf-varfiles="v0,v1,..." <==> --custom-config="module1.terraform.var-files.0:v0,module1.terraform.var-files.1:v1,...,module2.terraform.var-files.0:v0,module2.terraform.var-files.1:v1,..."

@avozicov
Copy link
Contributor

Test Passed
Acceptance Criteria:

  • Case when --var-files are defined in both global and module config it is expected for runner to overwrite global config by the ones provided in line

@eistrati
Copy link
Contributor Author

Checked.

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

No branches or pull requests

3 participants