Skip to content

Instantly share code, notes, and snippets.

View jaccus's full-sized avatar

Jaccus jaccus

View GitHub Profile
@gene_wood Glad you find the import functionality useful! Using the API you can also merge multiple Swagger files in a single API.
API Gateway calls Lambda functions using the public invoke endpoint. There are 2 ways to authorize a call to Lambda:
1. You can use roles in your account (what was call the invocation role). API Gateway will assume the role in your account and invoke the Lambda function. In this case your role needs to allow invocations in Lambda and have a trust relationship with apigateway.amazonaws.com that allows sts:AssumeRole
2. Using resource policies in Lambda, this is why you see the popup in the console. In this case the API Gateway console makes an AddPermission call to Lambda in the background to authorize API Gateway as a caller on your Lambda function (http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html)
when deploying APIs using the Swagger import you can use either method. For the first one, simply specify the invocation role ARN in the credentials field of the x-a