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 import not working on resources with pkey #2

Open
pablo-ruth opened this issue Mar 9, 2023 · 0 comments · May be fixed by #3
Open

terraform import not working on resources with pkey #2

pablo-ruth opened this issue Mar 9, 2023 · 0 comments · May be fixed by #3

Comments

@pablo-ruth
Copy link

pablo-ruth commented Mar 9, 2023

Hello,

We are trying to migrate from our Fortiadc provider (https://github.com/Ouest-France/terraform-provider-fortiadc) to this official provider, and we have a problem importing resources with "pkey".

For example with this Terraform config:

resource "fortiadc_load_balance_real_server" "rs1" {
  mkey        = "rs1"
  type        = "fqdn"
  fqdn        = "ourserver.mycorp.com"
  server_type = "static"
  status      = "enable"
}

resource "fortiadc_load_balance_pool" "rsp1" {
  mkey              = "rsp1"
  health_check      = "enable"
  health_check_list = "LB_HLTHCK_ICMP LB_HLTHCK_HTTPS"
}

resource "fortiadc_load_balance_pool_child_pool_member" "rsp1_rs1" {
  mkey           = "1"
  port           = "80"
  real_server_id = fortiadc_load_balance_real_server.rs1.id
  pkey           = fortiadc_load_balance_pool.rsp1.id
}

We tried to import the "fortiadc_load_balance_pool_child_pool_member" "rsp1_rs1" using multiple syntax, but we have errors:

$ terraform import fortiadc_load_balance_pool_child_pool_member.rsp1_rs1 1

fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Importing from ID "1"...
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Import prepared!
  Prepared fortiadc_load_balance_pool_child_pool_member for import
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Refreshing state... [id=1]
╷
│ Error: Error reading LoadBalancePoolChildPoolMember resource: 
│ {"payload":null}
│ 
│ 
╵

$ terraform import fortiadc_load_balance_pool_child_pool_member.rsp1_rs1 rsp1.1

fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Importing from ID "rsp1.1"...
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Import prepared!
  Prepared fortiadc_load_balance_pool_child_pool_member for import
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Refreshing state... [id=rsp1.1]
╷
│ Error: Error reading LoadBalancePoolChildPoolMember resource: 
│ {"payload":null}
│ 
│ 
╵

$ terraform import fortiadc_load_balance_pool_child_pool_member.rsp1_rs1 rsp1_1

fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Importing from ID "rsp1_1"...
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Import prepared!
  Prepared fortiadc_load_balance_pool_child_pool_member for import
fortiadc_load_balance_pool_child_pool_member.rsp1_rs1: Refreshing state... [id=rsp1_1]
╷
│ Error: Error reading LoadBalancePoolChildPoolMember resource: 
│ {"payload":null}

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant