GoogleCloudPlatform / terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Apache License 2.0
12.67k stars 1.65k forks source link

Does not work with `hashicorp/google` version higher than `4.59.0` #1932

Open Shion1305 opened 1 month ago

Shion1305 commented 1 month ago
terraform --version
Terraform v1.9.6
on darwin_arm64

Terraformer works with hashicorp/google version lower than 4.59.0

terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "4.59.0"
    }
  }
}

However with version from 4.60.0, terraformer does not work.

my log ```console 2024/09/29 07:24:38 google importing project shion1305-infra region global 2024/09/29 07:24:38 googleapi: Error 400: Invalid value for field 'region': 'global'. Unknown region., invalid 2024-09-29T07:24:39.659+0900 [ERROR] plugin.terraform-provider-google_v4.60.2_x5: Response contains error diagnostic: @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_severity=ERROR diagnostic_summary="Value Conversion Error" tf_proto_version=5.3 tf_rpc=Configure diagnostic_attribute="" tf_provider_addr=registry.terraform.io/hashicorp/google @module=sdk.proto diagnostic_detail= | An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer: | | Received null value, however the target type cannot handle null values. Use the corresponding `types` package type, a pointer type or a custom type that handles null values. | | Path: | Target Type: google.ProviderModel | Suggested `types` Type: basetypes.ObjectValue | Suggested Pointer Type: *google.ProviderModel tf_req_id=553ce56d-ce42-43d8-6166-44d2030658d6 timestamp="2024-09-29T07:24:39.659+0900" 2024/09/29 07:24:40 googleapi: Error 400: Invalid value for field 'region': 'global'. Unknown region., invalid 2024/09/29 07:24:40 google importing... gcs 2024/09/29 07:24:40 google done importing gcs 2024/09/29 07:24:40 Number of resources for service gcs: 18 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_acl.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket_iam_member.tfer--shion1305-infra 2024/09/29 07:24:40 Refreshing state... google_storage_bucket.tfer--shion1305-infra 2024-09-29T07:24:40.879+0900 [ERROR] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/4.60.2/darwin_arm64/terraform-provider-google_v4.60.2_x5 pid=90857 error="exit status 2" 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 rpc error: code = Unavailable desc = error reading from server: EOF 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:40 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:41 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:41 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Refreshing state... google_storage_bucket_iam_policy.tfer--shion1305-infra 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Refreshing state... google_storage_default_object_acl.tfer--shion1305-infra 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Refreshing state... google_storage_bucket_iam_binding.tfer--shion1305-infra 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 Fail read resource from provider, trying import command 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:42 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:42 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 WARN: Fail read resource from provider, wait 300ms before retry 2024/09/29 07:24:43 Fail read resource from provider, trying import command 2024/09/29 07:24:43 Fail read resource from provider, trying import command 2024/09/29 07:24:43 Fail read resource from provider, trying import command 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 rpc error: code = Canceled desc = context canceled 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 ERROR: Unable to refresh resource tfer--shion1305-infra 2024/09/29 07:24:43 Filtered number of resources for service gcs: 0 2024/09/29 07:24:43 google Connecting.... 2024/09/29 07:24:43 google save gcs 2024/09/29 07:24:43 google save tfstate for gcs ```
igorfraa commented 8 hours ago

Can confirm that.

Current plugin version is terraform-provider-google 6.12.0, two major releases ahead.