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

Support "terraform import" for storage pool resources #88

Closed
nmoun opened this issue Feb 13, 2023 · 2 comments
Closed

Support "terraform import" for storage pool resources #88

nmoun opened this issue Feb 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@nmoun
Copy link

nmoun commented Feb 13, 2023

Problem description:
I am trying to import an existing storage pool into my TF state, using the "terraform import" command. Similar issue than #33, except it concerns storage pools.

Steps:

  1. Create the resource in the TF configuration:
resource "netapp-gcp_storage_pool" "default" {
}
  1. Find the ID of the storage pool to import (e.g. in UI)
  2. Run the import
terraform import netapp-gcp_storage_pool.default b7d1e1aa-ac21-075b-6e15-06925c49635
  1. Use terraform show to update the empty resource file with the actual settings.
  2. Use terraform plan to verify that the resource file against the deployed storage pool.

Problem: the import fails:

terraform import "netapp-gcp_storage_pool.default" "b7d1e1aa-ac21-075b-6e15-06925c49635"
netapp-gcp_storage_pool.default: Importing from ID "b7d1e1aa-ac21-075b-6e15-06925c49635"...
netapp-gcp_storage_pool.default: Import prepared!
  Prepared netapp-gcp_storage_pool for import
netapp-gcp_storage_pool.default: Refreshing state... [id=b7d1e1aa-ac21-075b-6e15-06925c49635]
╷
│ Error: <html><body><h1>403 Forbidden</h1>
│ Request forbidden by administrative rules.
│ </body></html>

Reason: the region must be provided.

@okrause
Copy link
Contributor

okrause commented Feb 13, 2023

Acknowledged. The volume code is currently the only resource which supports importing.
As a reference: Adding import support for other resources would be similar to the code in getVolumeByID.

@wenjun666 wenjun666 added the enhancement New feature or request label Apr 4, 2023
@wenjun666
Copy link
Contributor

fix in release 23.4.0

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

No branches or pull requests

3 participants