Incorrect variable values being passed to modules
Closed this issue · 0 comments
btromanova commented
Expected behavior
Module is planned with variable values defined in the module config
Actual behavior
Module is planned with some variable values defined for the current module and some for the next one
Steps to reproduce
astro.yaml
---
terraform:
version: 0.11.7
modules:
- name: bar
path: ./bar
remote:
backend: local
backend_config:
path: /tmp/terraform-tests/bar-{{.environment}}.tfstate
variables:
- name: environment
values: [dev, staging, prod]
- name: foo
path: ./foo
remote:
backend: local
backend_config:
path: /tmp/terraform-tests/foo-{{.environment}}.tfstate
variables:
- name: environment
values: [mgmt]
foo/terraform.tf
terraform {
backend "local" {}
}
resource "null_resource" "foo" {}
bar/terraform.tf
terraform {
backend "local" {}
}
resource "null_resource" "bar" {}
astro plan
foo-mgmt: OK Changes (0s)
+ null_resource.foo
id: <computed>
bar-mgmt: OK Changes (0s)
+ null_resource.bar
id: <computed>
bar-dev: OK Changes (0s)
+ null_resource.bar
id: <computed>
bar-prod: OK Changes (0s)
+ null_resource.bar
id: <computed>
Done
bar-mgmt
is planned instead of bar-staging
in the plan above.