IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
339 stars 663 forks source link

Destroy resources failed with error: This object does not have an attribute named "ibm_is_bare_metal_server_initialization". #4626

Open peiyang2024 opened 1 year ago

peiyang2024 commented 1 year ago

Community Note

Terraform CLI and Terraform IBM Provider Version

Terraform version: Terraform v1.1 provider registry.terraform.io/ibm-cloud/ibm v1.54.0

Affected Resource(s)

Terraform Configuration Files

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

The sample code to recreate the issue https://github.com/vcfonvpc/catalog-debug

Debug Output

Panic Output

Expected Behavior

We're using the above terraform templates to deploy VPC bare metal server, and read its information with resource ibm_is_bare_metal_server_initialization. When bare metal server creation is successful, the resource works as expected. If bare metal creation fails, the following error is reported:

 2023/06/14 15:15:10 Terraform destroy | Error: Unsupported attribute
 2023/06/14 15:15:10 Terraform destroy | 
 2023/06/14 15:15:10 Terraform destroy |   on vpc_vmware_esxi_bare_metal.tf line 50, in locals:
 2023/06/14 15:15:10 Terraform destroy |   50:           password = module.zone_bare_metal_esxi.ibm_is_bare_metal_server_initialization.user_accounts[0].password,
 2023/06/14 15:15:10 Terraform destroy |     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
 2023/06/14 15:15:10 Terraform destroy |     β”‚ module.zone_bare_metal_esxi is object with 1 attribute "ibm_is_bare_metal_server_hostname"
 2023/06/14 15:15:10 Terraform destroy | 
 2023/06/14 15:15:10 Terraform destroy | This object does not have an attribute named
 2023/06/14 15:15:10 Terraform destroy | "ibm_is_bare_metal_server_initialization".

Actual Behavior

Steps to Reproduce

  1. Create a private catalog of software with the terraform template pasted on above. https://github.com/vcfonvpc/catalog-debug
  2. On Schematics workspace, bare metal server deployment failed with expected error, such as insufficient capacity of bare metal on selected zone.
  3. Destroy resources from workspace

Important Factoids

References

ujjwal-ibm commented 1 year ago

Looking at it