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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则