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

Support aggregation for module_name in provider meta #8346

Open
morgante opened this issue Jan 29, 2021 · 4 comments
Open

Support aggregation for module_name in provider meta #8346

morgante opened this issue Jan 29, 2021 · 4 comments

Comments

@morgante
Copy link

morgante commented Jan 29, 2021

Affected Resource(s)

  • google_*

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Currently, the provider_meta block with module_name only picks up the nearest definition. This works fine for simple modules, but if a module includes submodules the submodule resources will only be attributed to the submodule.

Instead, we should aggregate the names of all parent modules for a resource so they can all be attributed.

@ghost ghost added the enhancement label Jan 29, 2021
@rileykarson rileykarson changed the title Supper aggregation for module_name in provider meta Support aggregation for module_name in provider meta Jan 29, 2021
@rileykarson
Copy link
Collaborator

rileykarson commented Feb 11, 2021

Spoke with SDK folks- this is unlikely to happen anytime soon, and they're unsure if it's feasible. Would it be possible to plumb attribution through an input on the submodule(s)?

@morgante
Copy link
Author

Thanks for checking Riley, looks like we can work around this with variables (ref. terraform-google-modules/terraform-google-kubernetes-engine#830).

@bharathkkb
Copy link

@rileykarson looks like provider_meta interpolation was not meant to be supported upstream hashicorp/terraform#28061. We reverted terraform-google-modules/terraform-google-kubernetes-engine#830 via terraform-google-modules/terraform-google-kubernetes-engine#845. We may have to explore other options to support this.

@rileykarson
Copy link
Collaborator

FYI @megan07

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

No branches or pull requests

3 participants