Open oponomarov-tu opened 1 month ago
try setting top_locale
allocations are only made in the pools with a locale and… iirc you must also be constructing your provider in the same region where the locale is (i could be wrong on this point)
It's a timing issue. The sub-pools are allocated when the module is applied and the CIDR that we want to allocate (exclude) is already allocated to the first sub-pool.
So we get this error when trying to allocate the CIDR we want to exclude:
So either we need to:
top_cidr_allocations
input var to the module.Would option 1. make sense to add to this module as a general feature going forward? Otherwise we'll just go with one of our workarounds.
Initially I had set the allocations inside but it ended up being impossible because of how the TF provider client and subsequent calls are made to regions :/ which is how you found the PR where I took it out.
your best bet may be to use the sub-pool module and roll your own graph with the structure forced by the parent module.
I am sorry! I really wish this was possible… The problem has to do with the fact that I Pam as a service is managed from a single region, but then also add items that are accessible via other regions. The resource for an allocation has to call the region directly, which is not possible with a module since we’re speaking to the “parent region”. Or, rather, it’s only possible in the parent region
some hope… there’s a proposal to allow for setting region on a resource, individually… if this ever gets merged that would help resolve this type of issue: https://github.com/hashicorp/terraform-provider-aws/pull/31517
Hi,
cidr_allocations
input variable has been removed in https://github.com/aws-ia/terraform-aws-ipam/commit/d04f955cca1c9e96ba00af70ea4079496d45154f (https://github.com/aws-ia/terraform-aws-ipam/pull/10). How one does ensure that certain CIDR is excluded from the top-level root pool?Something like this does not work: