http authorizer lambda permissions

0

Hi team,

I created an HttpAuthorizer via CDK and attached to it the lambda function authorizer

but I don't find a way to allow the API gw to call my lambda authorizer.

on the console we have the option: "automatically authorize API gw to call your function"

I even create an API role and give it permission to call my lambda authorizer but there is no way to link it to the HttpAuthorizer.

is there a way like a boolen to enable API gw to call my lambda authorizer or to link the apiRole directly to the HTTP authorizer ?

Thank you!!

1 個回答
0
已接受的答案

I figured it out using this link :

https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html

I need to create a permission for lambda authorizer and construct the source ARN manually :

sourceArn : source-arn "arn:aws:execute-api:region:accountId:api-id/authorizers/authorizer-id"
sourceArn: `arn:aws:execute-api:${Aws.REGION}:${Aws.ACCOUNT_ID}:${myapi.apiId}/authorizers/${myhttpAuthorizer.authorizerId}`,
Jess
已回答 2 年前

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

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

回答問題指南