Do HTTP APIs have same IAM integrations as REST APIs?

0

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 apigateway.amazonaws.com --source-arn "arn:aws:execute-api:..."), etc?

AWS
Ed S
已提問 4 年前檢視次數 345 次
1 個回答
0
已接受的答案

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"
--principal apigateway.amazonaws.com
--source-arn "arn:aws:execute-api:us-west-1:[your accunt number]:[your gateway id]/"
AWS
Ed S
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南