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

Output variable subnets_secondary_ranges cannot be used in dependent modules. #92

Closed
erdebee opened this issue Oct 29, 2019 · 2 comments · Fixed by #93
Closed

Output variable subnets_secondary_ranges cannot be used in dependent modules. #92

erdebee opened this issue Oct 29, 2019 · 2 comments · Fixed by #93

Comments

@erdebee
Copy link

erdebee commented Oct 29, 2019

A new bug is introduced into this module, due to the introduction of the following code:
#81

As written in https://www.terraform.io/docs/configuration/data-sources.html#data-resource-dependencies adding a depends_on in a data declaration, the execution of the data value is postponed to the apply phase of terraform.
The created_subnets value is being used in the output of the module for outputting the subnets_secondary_ranges.
We are using the secondary ranges in other modules, as they depend on these ranges (a kubernetes cluster uses secondary ranges for its pods and containers).
Running a terraform plan & apply will now always cause a replacement of the kubernetes cluster, as terraform is not able to find the diff of the state during the plan phase.

To fix this issue we need to get rid of the depends_on in the data block. Perhaps this PR already fixes the issue, but just for 2.x:
#73

Could a patch be created for a 1.4.1 or whatsoever bugfix release?

@erdebee erdebee changed the title Depends_on in created_subnets makes Output variable subnets_secondary_ranges cannot be used in dependant modules. Oct 29, 2019
@erdebee erdebee changed the title Output variable subnets_secondary_ranges cannot be used in dependant modules. Output variable subnets_secondary_ranges cannot be used in depenent modules. Oct 29, 2019
@erdebee erdebee changed the title Output variable subnets_secondary_ranges cannot be used in depenent modules. Output variable subnets_secondary_ranges cannot be used in dependent modules. Oct 29, 2019
@morgante
Copy link
Contributor

Thanks for the report, v1.4.1 should fix this.

@jantoebes
Copy link

And thank you @morgante for providing a solution so fast :-)

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