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

terraform doesn't like it when a managed IP gets removed from infoblox by hand #52

Closed
scumola opened this issue Jan 9, 2020 · 5 comments

Comments

@scumola
Copy link

scumola commented Jan 9, 2020

I added an IP using the infoblox_ip_allocation block (it worked well, BTW), then removed the IP address by-hand in the InfoBlox UI. When terraform ran again, I expected it to see that the IP was missing and re-add it, but instead the error I got back from terraform was:

Error: Error getting IP from network block(10.120.0.0/13): WAPI request error: 404('404 Not Found')
Contents:
{ "Error": "AdmConDataNotFoundError: Reference fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuMTIwLjguMjEuMC4u:10.120.8.21/default not found",
  "code": "Client.Ibap.Data.NotFound",
  "text": "Reference fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTAuMTIwLjguMjEuMC4u:10.120.8.21/default not found"
}
@saiprasannasastry
Copy link
Contributor

that is because terraform doesnt know that you have deleted it manually, and in state file the resource is there, try deleting the state file and delete the record in NIOS and run again that should work

@scumola
Copy link
Author

scumola commented Jan 11, 2020

I'm pretty sure that it's terraform's job to restore (build if needed) resources if they're missing. I specify what I want to exist in the *.tf files and if they're missing, terraform is supposed to do whatever's necessary to make the resources match what is specified in the *.tf file. I shouldn't have to delete the *.tfstate file or manage that state file by-hand at all.

@saiprasannasastry
Copy link
Contributor

Hi, when you run terraform again, it first tries to do a get using that IP, The error is coming from Infoblox side telling that it is not able to find that network/IP to get, i understand it's terraform job to create again if it does not find it. But infoblox cant return an empty value to make terraform understand that there is no resource. From infoblox side the only thing we do is throw an error and the same gets reflected during next apply

@scumola
Copy link
Author

scumola commented Jan 16, 2020

InfoBlox is returning a 404 - "Not Found" and "Client.Ibap.Data.NotFound". Can't you interpret that as "this record doesn't exist" and create a new one?

@AvRajath
Copy link
Contributor

Hi, We do not expect/encourage our customers to explicitly delete the data in NIOS manually when we are using automation to create them. If you still have concerns about it then its possible to create users and assign roles to the users on NIOS on what they can modify/delete.

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

3 participants