GoogleCloudPlatform/terraformer

Error when importing AWS alb

renzowit opened this issue · 11 comments

Command: terraformer import aws --resources=alb --regions=eu-west-1

output:
2024/06/11 16:36:22 aws importing region eu-west-1
2024/06/11 16:36:23 aws importing... alb
2024/06/11 16:36:23 aws done importing alb
2024/06/11 16:36:23 Number of resources for service alb: 3
2024/06/11 16:36:23 Refreshing state... aws_lb_target_group.tfer--test
2024/06/11 16:36:23 Refreshing state... aws_lb.tfer--test
2024/06/11 16:36:23 Refreshing state... aws_lb_listener.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-591217560485-003A-listener-002F-app-002F-test-002F-dcab94c91c4f6e4d-002F-5b4e04fe42683b14
2024-06-11T16:36:24.002+0200 [ERROR] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.53.0/darwin_amd64/terraform-provider-aws_v5.53.0_x5 pid=10049 error="exit status 2"
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--test
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-591217560485-003A-listener-002F-app-002F-test-002F-dcab94c91c4f6e4d-002F-5b4e04fe42683b14
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--test
2024/06/11 16:36:25 Filtered number of resources for service alb: 0
2024/06/11 16:36:25 aws Connecting....
2024/06/11 16:36:25 aws save alb
2024/06/11 16:36:25 aws save tfstate for alb

I faced the same issue while abstracting alb through terraformer.
Below are th eversions i am using:
terraformer: version v0.8.24
terraform: v1.6.0
go: go1.16.4 darwin/amd64

issue: terraformer import aws --resources=alb --regions=eu-west-1 --profile=""
returns:
2024/06/20 11:15:15 aws importing region eu-west-1
2024/06/20 11:15:16 aws importing... alb
2024/06/20 11:15:16 aws done importing alb
2024/06/20 11:15:16 Number of resources for service alb: 5
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:16 Refreshing state... aws_lb.tfer--xxx-nlb
2024/06/20 11:15:16 Refreshing state... aws_lb_listener.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxx-003A-listener-002F-net-002F-dev-pofp-nlb-002F-6bc98b94efb85469-002F-183812bd6791087e
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group.tfer--xxx-target-group
2024/06/20 11:15:16 ERROR: Read resource response is null for resource aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:16 ERROR: Read resource response is null for resource aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024-06-20T11:15:16.708+0100 [ERROR] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.54.1/darwin_arm64/terraform-provider-aws_v5.54.1_x5 pid=12679 error="exit status 2"
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxxp-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--dev-pofp-nlb
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxxx-003A-listener-002F-net-002F-xxxp-nlb-002F-6bc98b94efb85469-002F-183812bd6791087e
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--xxxp-target-group
2024/06/20 11:15:18 Filtered number of resources for service alb: 0
2024/06/20 11:15:18 aws Connecting....
2024/06/20 11:15:18 aws save alb
2024/06/20 11:15:18 aws save tfstate for alb

Downgrading the provider to 4.* is a temporary fix