Do HTTP APIs have same IAM integrations as REST APIs?


Regarding the newly announced simplified HTTP APIs for API Gateway, do they include the same IAM integrations as traditional REST APIs?

For example, when adding permissions to invoke a Lambda to the API Gateway service, are HTTP API supported with the same service principals (--principal --source-arn "arn:aws:execute-api:..."), etc?

Ed S
asked 4 years ago377 views
1 Answer
Accepted Answer

Yes the same IAM integrations apply for HTTP APIs as for REST APIs. The same IAM integrations apply for controlling access to API endpoints (HTTP and REST) as well as invoking backend AWS services like Lambda.

More specifically you can refer to this public blog post for HTTP APIs and adding permissions to invoke a Lambda function that is integrated with an HTTP API endpoint:

Don’t forget that you will need to add a Lambda resource policy permission to the function to allow API Gateway to invoke your function. For example:

aws lambda add-permission
--statement-id dd0dffb7-971e-5952-9699-38493cf34293
--action lambda:InvokeFunction
--function-name "arn:aws:lambda:us-west-1:[your account number]:function:Echo"
--source-arn "arn:aws:execute-api:us-west-1:[your accunt number]:[your gateway id]/"
Ed S
answered 4 years ago
profile picture
reviewed 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions