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

Import fails on nsxt_ip_pool_allocation_ip_address #315

Closed
wilsonehusin opened this issue May 16, 2020 · 1 comment
Closed

Import fails on nsxt_ip_pool_allocation_ip_address #315

wilsonehusin opened this issue May 16, 2020 · 1 comment
Labels

Comments

@wilsonehusin
Copy link

Scenario

I lost my tfstate and trying to recover the components. I would like to import the IP associated with the lost tfstate with:

terraform import nsxt_ip_pool_allocation_ip_address.inbound_ip 10.200.10.1

Expected

IP to be added to my tfstate

Actual

nsxt_ip_pool_allocation_ip_address.inbound_ip: Importing from ID "10.200.10.1"
nsxt_ip_pool_allocation_ip_address.inbound_ip: Import prepared!
  Prepared nsxt_ip_pool_allocation_ip_address for import
nsxt_ip_pool_allocation_ip_address.inbound_ip: Refreshing state... [id=10.200.10.1]

Error: Error obtaining pool id

(relevant line of code)

Notes

I have validated through /api/v1/pools/ip-pools/:pool_id/allocations that 10.200.10.1 is still allocated.

My terraform configuration:

data "nsxt_ip_pool" "ip_pool" {
  display_name = IP_POOL_NAME
}
resource "nsxt_ip_pool_allocation_ip_address" "inbound_ip" {
  ip_pool_id = data.nsxt_ip_pool.ip_pool.id
}

In a tfstate produced by terraform apply, I can see that ip_pool_id seem to match :pool_id that I used for validating allocation through HTTP API.

I imagine this might be a missing step to check for nsxt_ip_pool.ip_pool?

@annakhm annakhm added the bug label May 21, 2020
@annakhm
Copy link
Collaborator

annakhm commented May 21, 2020

Thanks for reporting this! Fixing with https://github.com/terraform-providers/terraform-provider-nsxt/pull/319

@annakhm annakhm closed this as completed May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants