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

Add CIDR collapse functionality #33629

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zachsdd
Copy link

@zachsdd zachsdd commented Aug 3, 2023

Adding a CIDR collapse function to terraform for squashing network ranges to avoid use of external data sources (often not encouraged by security policies)

Takes in a list of cidr ranges as a string list and returns a list of superset string values.

@hashicorp-cla
Copy link

hashicorp-cla commented Aug 3, 2023

CLA assistant check
All committers have signed the CLA.

@mootpt
Copy link
Contributor

mootpt commented Aug 4, 2023

@zachsdd could you add docs for new function similar to https://github.com/hashicorp/terraform/blob/main/website/docs/language/functions/cidrnetmask.mdx

@digital-content-events
Copy link

digital-content-events bot commented Aug 30, 2023

📄 Content Checks

Updated: Wed, 30 Aug 2023 19:29:41 GMT

Found 1 error(s)

docs/language/functions/cidrcollapse.mdx

Position Description Rule
1:1-1:1 This file is not present in the nav data file at data/language-nav-data.json. Either add a path that maps to this file in the nav data or remove the file. If you want the page to exist but not be linked in the navigation, add a hidden property to the associated nav node. no-unlinked-pages

@crw
Copy link
Collaborator

crw commented Sep 7, 2023

Thanks for this submission! Ultimately, this function will need to be built as a plugin function provider, as opposed to a function built into Terraform. As such it is waiting for the implementation of plugin function providers. Please see:

There are a number of other CIDR-related function PRs, probably the ideal goal would be to wrap those together into one CIDR function provider. The organization for such an effort remains to be seen. Thanks again for your submission!

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

Successfully merging this pull request may close these issues.

4 participants