terraformer: Error: Import AWS Lambda ends w/ an error

I’m trying to import AWS Lambda and get an error related to GetPolicy. There is an open question reg. it in StackOverflow that was opened a week ago.

My feeling that it is related to Line 104 @ https://github.com/GoogleCloudPlatform/terraformer/blob/master/providers/aws/lambda.go

sudo ./terraformer import aws --resources=lambda --regions=eu-west-1
2023/01/04 23:01:50 aws importing region eu-west-1
2023/01/04 23:01:50 aws importing... lambda
2023/01/04 23:01:51 aws error initializing resources in service lambda, err: operation error Lambda: GetPolicy, https response error StatusCode: 404, RequestID: 67d8e12c-adf2-405f-9d65-5045981e0cb7, ResourceNotFoundException: The resource you requested does not exist.
2023/01/04 23:01:51 aws Connecting....

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 19

Most upvoted comments

This is still an issue that wasn’t fixed. I’m having the same problem.

Almost a year has passed, and this issue is still relevant. Is it me, or is terraformer not keeping up since terraform introduced the -generate-config-out option in plan for resources listed in import blocks?

This bug basically makes importing lambdas completely broken. What a shame, since terraformer is such a cool project.

Please reopen this issue.

Still relevant. Please reopen this issue.

This still an issue on version v0.8.24

Same problem.

This is still an issue. Please re-open the issue

Same problem. I have a lot of lambda without policy and cant add policy right now. How I can import all of them

@mosheka - i have been looking at cloudtrail logs and it appears that it fails on finding the first lambda with no resource policy (inline policy doesn’t cut it apparently). so, if you can put resource policy on all your lambdas you should (theoretically because im still going through my lambdas to add missing policy) get it to work.

my feeling is that this issue needs a fork-n-fix such that where there is no policy (404), it attempts inline and otherwise does not raise exception.