cloudposse / terraform-aws-vpc-peering-multi-account

Terraform module to provision a VPC peering across multiple VPCs in different accounts by using multiple providers
https://cloudposse.com/accelerate
Apache License 2.0
129 stars 92 forks source link

Module does not support for_each due to hard coded providers #48

Open heathsnow opened 3 years ago

heathsnow commented 3 years ago

Describe the Bug

The module is unable to support for_each since it contains provider configuration:

Module "foo" cannot be used with for_each because it contains a
nested provider configuration for "aws.requester", at
.terraform/modules/foo/requester.tf:60,10-15.

Expected Behavior

The module should support for_each loops.

Additional Context

I believe passing the providers into the module (instead of configuring the providers w/in the module) would do the trick. I labeled this as bug but it may be a feature request instead.

dtrinf commented 2 years ago

Hi all, any update in this feature?

nitrocode commented 2 years ago

I think this would be a good extension to this module. Since this would be a breaking change, we'd require a migration doc, updated examples, and move to the next major version of 1.x. We would also try to close as many open issues as possible with prs for that release.

I'd like to work on this when I find the time. Feel free to contribute the change too and we will review.