-
Notifications
You must be signed in to change notification settings - Fork 31
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
Error: Subnet either missing or multiple results returned by reading subnet after creation #43
Comments
@pavel-z1 - is it possible to fix this one easily? |
Hi @MrKoopaKiller Check this feature in your environment |
Thanks @pavel-z1! I'll test the changes soon! @lord-kyron Do you think is it possible to create a new tag including the latest commits? |
@MrKoopaKiller I will prepare new tag and new release build tomorrow! |
Ping @lord-kyron 🙏 |
@MrKoopaKiller published with the latest release! |
Affected resource
phpipam_subnet
resourceIssue:
The phpIPAM allow us to disable the strict mode per section and also allow us to create more than one subnet using the same cidr in diferente sections. That being said, if we try to create 2 subnets with the same CIDR but in different sections, it should work, but in fact, it's not working and terraform throws an error:
Seems the main reason is by this function that tries to retry if the subnet was correctly create querying by CIDR:
terraform-provider-phpipam/vendor/github.com/lord-kyron/phpipam-sdk-go/controllers/subnets/subnets.go
Lines 120 to 123 in 1dd3754
But since we have more than 1 result, it throws the error:
terraform-provider-phpipam/plugin/providers/phpipam/resource_phpipam_subnet.go
Lines 62 to 64 in 1dd3754
Use case:
Just to give a quick explanation why I'm using this in that way. I have multiples AWS accounts, and I'm putting all the vpc and subnets from all this accounts and all regions in the phpIPAM. AWS regions has the default vpc, using the same CIDR and it causes the error. If for some reason the subnets weren't correctly architect and an overlap occurs, is it possible to face the same error even if the strict mode is disabled in the phpIPAM.
Expected Behavior
Be able to create subnets using the same CIDR.
The text was updated successfully, but these errors were encountered: