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

Sort generated subnet CIDRs when specified with newbits only #792

Open
devoncrouse opened this issue Aug 9, 2023 · 0 comments
Open

Sort generated subnet CIDRs when specified with newbits only #792

devoncrouse opened this issue Aug 9, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@devoncrouse
Copy link
Member

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

Description

The subnets input variable can be defined using only the newbits parameter for each entry (default), using the cidrsubnets function internally to calculate starting addresses within the VCN. This may lead to sub-optimal utilization and fragmentation of addresses depending on size and ordering.

To overcome this, we can sort the configured subnets by newbits in provided arguments to cidrsubnets, however this is non-trivial due to the way Terraform maps are ordered implicitly; we will need transformations to e.g. prefix/split map keys internally to preserve an explicit ordering.

New or Affected Resource(s)

module.network.module.network.oci_core_subnet.oke[*]

Potential Terraform Configuration

subnets = {
    bastion  = { newbits = 13 }
    operator = { newbits = 13 }
    cp       = { newbits = 13 }
    int_lb   = { newbits = 11 }
    pub_lb   = { newbits = 11 }
    workers  = { newbits = 4 }
    pods     = { newbits = 2 }
}

References

@devoncrouse devoncrouse added the enhancement New feature or request label Aug 9, 2023
@devoncrouse devoncrouse added this to the 5.1.0 milestone Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant