Terraform crash error while running terraform import on IBM cloud

1.3k views Asked by At

I am trying to import ibm-cos-bucket and cos-instance from IBM cloud. I am able to import cos-instance however, getting error while importing ibm-cos-bucket.

Error: rpc error: code = Unavailable desc = transport is closing

*[ERROR] : eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing [ERROR] : eval: terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing" [DEBUG] plugin: plugin exited panic: runtime error: index out of range [1] with length 1

Terraform crashed!!!

here is sample resource block:- resource "ibm_cos_bucket" "mybucket" {}

Please help me in this regards. Thanks in advance!

2

There are 2 answers

0
Marcin On

This seems to be a fault/bug of IBM provider. Simillar issue for aws is here.

Thus, you can report the problem by making the issue on IBM provider's github:

0
grommir On

Are you using CRN or ID for import?

According to doc's ID must be used.

id = $CRN:meta:$buckettype:$bucketlocation

ID can be easily find by using data. Here is an example.

data "ibm_cos_bucket" "my-bucket" {
  bucket_name = "my-bucket"
  resource_instance_id = data.ibm_resource_instance.my-resource.id
  bucket_region = "us-south"
  bucket_type = "region_location"
}

output "bucket-info" {
  value = data.ibm_cos_bucket.my-bucket.id
}