terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

Import ibm_container_vpc_cluster is missing zones blocks

Open SRodi opened this issue 10 months ago • 0 comments

Terraform import for ibm_container_vpc_cluster is failing as "zones" blocks are missing.

❯ terraform plan -generate-config-out=generated.tf
ibm_container_vpc_cluster.cluster: Preparing import... [id=c4i5focd0ltfi203fbog]
data.ibm_resource_group.resourceGroup: Reading...
ibm_container_vpc_cluster.cluster: Refreshing state... [id=c4i5focd0ltfi203fbog]
data.ibm_is_vpc.vpc: Reading...
data.ibm_resource_group.resourceGroup: Read complete after 3s [id=a9f52d88da0d41c9a0c52cd2dad7eb74]
data.ibm_is_vpc.vpc: Read complete after 8s [id=r006-f959e8c7-d35b-479e-ac7b-4df32d07c007]

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Warning: Config generation is experimental
│ 
│ Generating configuration during import is currently experimental, and the generated configuration format may change in future versions.
╵
╷
│ Error: Insufficient zones blocks
│ 
│   on generated.tf line 1:
│   (source code not available)
│ 
│ At least 1 "zones" blocks are required.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

❯ terraform version
Terraform v1.5.7
on darwin_amd64
+ provider registry.terraform.io/ibm-cloud/ibm v1.61.0

Affected Resource(s)

  • ibm_container_vpc_cluster

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

import {
  to = ibm_container_vpc_cluster.cluster
  id = "c4i5focd0ltfi203fbog"
}

Debug Output

  • link to debug output https://gist.github.com/SRodi/ef47e251b44ef9d6a28fb2feb62b9c07

Panic Output

Expected Behavior

The resource should be imported correctly by generating the resource configuration and the consequent Terraform apply should be successful.

Actual Behavior

The generated Terraform configuration is the following

# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.

# __generated__ by Terraform
resource "ibm_container_vpc_cluster" "cluster" {
  cos_instance_crn                = null
  crk                             = null
  disable_public_service_endpoint = false
  entitlement                     = null
  flavor                          = ""
  force_delete_storage            = null
  host_pool_id                    = null
  image_security_enforcement      = true
  kms_account_id                  = null
  kms_instance_id                 = null
  kube_version                    = "4.12.51_openshift"
  name                            = "ic4v-roks-dallas-nonprod"
  operating_system                = null
  patch_version                   = null
  pod_subnet                      = "172.17.0.0/18"
  resource_group_id               = "a9f52d88da0d41c9a0c52cd2dad7eb74"
  retry_patch_version             = null
  secondary_storage               = null
  service_subnet                  = "172.21.0.0/16"
  tags                            = ["nextgen", "nonprod"]
  update_all_workers              = null
  vpc_id                          = "r006-f959e8c7-d35b-479e-ac7b-4df32d07c007"
  wait_for_worker_update          = null
  wait_till                       = null
  worker_count                    = 0
  worker_labels                   = {}
}

But the import fails with the following message

╷
│ Error: Insufficient zones blocks
│ 
│   on generated.tf line 1:
│   (source code not available)
│ 
│ At least 1 "zones" blocks are required.
╵

Steps to Reproduce

  1. terraform plan -generate-config-out=generated.tf

Important Factoids

  • Openshift Cluster on VPC version 4.12.51_1585_openshift

References

SRodi avatar Apr 11 '24 10:04 SRodi