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

Data resource uses hinting to search #3

Open
gradinDotCom opened this issue Nov 2, 2020 · 4 comments
Open

Data resource uses hinting to search #3

gradinDotCom opened this issue Nov 2, 2020 · 4 comments

Comments

@gradinDotCom
Copy link

If you have a network which is built semantically on block divisions:

  • 10.0.0.0/8 (Block)
    • 10.0.0.0/16 (Block)
      • 10.0.0.0/24 (Network)
    • 10.0.128.0/16 (Block)

A hint-based search on a host (10.0.0.1) is always going to refer to the network when you may want one of the blocks instead.

Could the data resource be based upon the searchByObjectTypes(cidr, type, 0, 1) instead?

@adarobin
Copy link
Member

@gradinDotCom The hint based search is definitely quirky and not optimal. I based my original workflow off of some internal PowerShell code we have.

I don't want to break the existing data source, but adding a new data source for searchByObjectTypes seems like it might be useful.

@adarobin
Copy link
Member

@gradinDotCom What if you set type = "IP4Block" on your bluecat_ip4_network-block-range data source? Does that get you the information you want?

https://registry.terraform.io/providers/umich-vci/bluecat/latest/docs/data-sources/ip4_network-block-range#type

@gradinDotCom
Copy link
Author

Modifying the data source should be a good method to get this. When I read the documentation resources on the Terraform site, I didn't get the impression that was an option. Is that an option today, or are you just thinking about an easy to solve it?

@adarobin
Copy link
Member

adarobin commented Dec 8, 2020

@gradinDotCom You should be able to change the type on the existing bluecat_ip4_network-block-range to control what is returned. That said, I'm not sure how it will handle nested blocks.

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

No branches or pull requests

2 participants