4
votes

I am using AWS API Gateway and AWS Lambda. I am configuring the API gateway to integrate with a lambda function.

When I select the region that the lambda function is in, the lambda function is not visible on the list of available functions.

When I try and configure the integration, from the AWS API Gateway web interface, as an AWS service and I input the ARN number for the lambda function, I get an invalid ARN number. The number is correct.

2
Maybe you're creating an API Gateway on a different region or on a different account from your Lambda function? - Noel Llevares
@dashmug though Lambda and API gateway are in two different regions he should get Lambda function while selecting the Lambda region API gateway - Vijayanath Viswanathan
Hey, I got it to work, but I am unsure as to why I could see some lambda functions and not others. For integrating the lambda function as an AWS resource: I was entering the lambda ARN in place of the access policy ARN. For integrating the lambda function as a lambda function: in the IAM settings I had a role that had permissions to access lambda functions but I had not added API Gateway to the trusted list of users, previously it had been added. When I updated the policy, I could see newly created lambdas. - bloopiebloopie

2 Answers

7
votes

I was facing the same problem. I could not find my lambda function in the drop down. Then I simply copy pasted my lambda function name and saved the api gateway. It worked for me. I think the text box for lambda function is somehow showing cached results.

0
votes

tl;dr: Had inputted information incorrectly and You have to add AWS API Gateway to the list of users that can use AWS Lambda, this is done by creating a user role, giving the role permission to access use AWS Lambda, and adding AWS API Gateway to the list of trusted users that can use the role. This can all be done using the AWS IAM web portal.

Hey, I got it to work, but I am unsure as to why I could see some lambda functions and not others.

For integrating the lambda function as an AWS resource using the AWS API Gateway web interface: I was entering the lambda ARN in place of the access policy ARN.

For integrating the lambda function as a lambda function using the AWS API Gateway web interface: In the IAM settings I had a role that had permissions to access lambda functions but I had not added API Gateway to the trusted list of users. When I updated the policy, adding AWS API Gateway to the list of trusted users, I could see newly created lambdas.

I don't know if these changes are what fixed the problem, but it works now. Previously AWS API Gateway had been added to the list of trusted policy users. I removed it when I was not going to be using lambda functions. After updating the policy today, I could see newly created lambdas. Before updating the policy today, I had been only able to see lambda functions that the API gateway could access before I had originally removed the policy. Also, for the duration of time that the API Gateway was not added to the list of trusted users, some of the lambda functions that you could view through the API Gateway web interface were listed as being in different regions then where they currently were, or had ever been; there were even some that I do not think I had added.