How to import aws_lambda_permission in terraform

amazon-web-services, aws-lambda, terraform

Solution

At the time of writing Terraform does not have an importer for this resource, so it's not possible to import it automatically using the `terraform import` command.

Since a Lambda permission is a subordinate resource belonging to a Lambda function, once there is support for importing it the most likely way it would be handled is to import it as a side-effect of importing the function itself; the id of the permission alone is not enough information to retrieve it.

Problem

How can I use `terraform import` with resources of type `aws_lambda_permission` in terraform? What should the second argument be?

Original source