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_required_providers: fix regression with configuration_aliases #1454

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

bendrucker
Copy link
Member

@bendrucker bendrucker commented Jul 28, 2022

Fixes a regression, described in #1450. When evaluating an entry in required_providers, this adds a variable (dynamic value) with the provider's name, allowing the evaluation of configuration_aliases. This evaluation is looser than Terraform would perform, e.g., configuration_aliases = [aws.foo.bar] would presumably be considered valid. References to other providers should still fail.

Closes #1450

@bendrucker bendrucker requested a review from wata727 July 28, 2022 23:09
Copy link
Member

@wata727 wata727 left a comment

Choose a reason for hiding this comment

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

👍

// @see https://www.terraform.io/language/modules/develop/providers#provider-aliases-within-modules
name: cty.DynamicVal,
},
})
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. FWIW, Terraform core uses hcl.ExprMap, so it's probably best to do so.
https://github.com/hashicorp/terraform/blob/v1.2.6/internal/configs/provider_requirements.go#L78

@wata727 wata727 merged commit 07a8f8c into master Jul 29, 2022
@wata727 wata727 deleted the bendrucker/issue1450 branch July 29, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

terraform_required_providers Error: Variables not allowed
2 participants