lord-kyron / terraform-provider-phpipam

Terrform provider for PHPIPAM
https://registry.terraform.io/providers/lord-kyron/phpipam/latest
Apache License 2.0
54 stars 30 forks source link

Add "l2_domain_id" to the Argument Reference of "phpipam_vlan" Data Source #27

Closed basic39 closed 3 years ago

basic39 commented 4 years ago

Hello,

I am still searching for a solution how I can identify the correct subnet by VLAN. A good way is to find the VLAN and then find the subnet by the Description (VLAN.Name == Subnet.Description in my case). The problem is that in PHPIPAM there are multiple subnets with the same VLAN - Number(but different l2 domain). Because of this

data "phpipam_vlan" "vlan" {
  number = 1000
}

returnes error:

Error: VLAN search returned either zero or multiple results. Please correct your search and try again

Could "l2_domain_id" be added to the Argument Reference of "phpipam_vlan" Data Source?

PS @pavel-z1 I can confirm, that issue #17 is resolved - terraform don't crashes when using "custom_field_filter" after I updated the "phpipam-sdk-go" module. Thank you. But then I realized, that VLAN isn't a custom field, so the subnet can not be identified by VLAN directly, so I make it by subnet description as mentioned above

lord-kyron commented 3 years ago

@pavel-z1 - is this something easy to implement and fix or help will be needed here also?

pavel-z1 commented 3 years ago

Hi @basic39 It is not clear, how exactly should be looks like a query to the phpIPAM to get VLAN with number and l2_domain. In the phpIPAM documentation, I don't see such a possibility https://phpipam.net/api/api_documentation/

Can you please provide CURL example that will execute the search operation that you need?

lord-kyron commented 3 years ago

@basic39 - can you provide CURL example of this as @pavel-z1 asked? We will need this to understand what exactly you want to do. Thanks!

basic39 commented 3 years ago

I am not working more with terraform and phpipam, so I cant provide this information.