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

ERROR: Read resource response is null for resource aws_api_gateway_resource #1943

Closed HLN177 closed 3 weeks ago

HLN177 commented 3 weeks ago

Hi,

I've recently been migrating my existing AWS architecture to Terraform, and thanks to the Terraformer tool, which saved a lot of time. However, I encountered some issues while using Terraformer to import the API Gateway. For instance, when I run the following command:

terraformer import aws --resources=api_gateway --regions=eu-central-1

nearly all resources are imported into the state and generate HCL, except for api_gateway_resource. After a brief code debug, I found that when refreshing api_gateway_resources, it always results in a resource not found error. Error as follow:

2024/10/28 15:58:11 Refreshing state... aws_api_gateway_resource.tfer--xxxxxxxxxx 2024/10/28 15:58:13 ERROR: Read resource response is null for resource aws_api_gateway_resource.tfer--xxxxxxxxx ...... ERROR: Unable to refresh resource tfer--xxxxxxxxxxx

Could you please explain why this is happening?

HLN177 commented 3 weeks ago

Fixed by upgrading terraform-aws-provider to latest version : )