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

Adding type constraints to variables #43

Merged
merged 3 commits into from
Mar 4, 2020

Conversation

lpena-recurly
Copy link

For best practices and for users who implement terragrunt [0]. Type constrains should be added [1]. Without specifying these constraints, applying a terragrunt plan/apply results in type errors [2], depending on the type constraints.

In terragrunt, "values are being passed in with environment variables and json, the type information is lost when crossing the boundary between Terragrunt and Terraform. You must specify the proper type constraint on the variable in Terraform in order for Terraform to process the inputs to the right type" [3].

tl;dr lists and maps currently do not work with terragrunt because type constraints are not explicitly set.

[0] https://github.com/gruntwork-io/terragrunt
[1] https://www.terraform.io/docs/configuration/variables.html#type-constraints
[2] Invalid value for "inputMap" parameter: lookup() requires a map as the first
argument.
[3] https://terragrunt.gruntwork.io/docs/reference/config-blocks-and-attributes/#inputs

@morgante morgante self-requested a review March 3, 2020 19:33
Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the addition, just one change and also please regenerate docs (make docker_generate_docs).

variables.tf Outdated Show resolved Hide resolved
@lpena-recurly
Copy link
Author

Thanks for the addition, just one change and also please regenerate docs (make docker_generate_docs).

should be all good now.

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@morgante morgante merged commit 45d42a1 into terraform-google-modules:master Mar 4, 2020
@lpena-recurly
Copy link
Author

Thanks for the contribution!

No problem!

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

Successfully merging this pull request may close these issues.

2 participants