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 Antwort
0
Akzeptierte Antwort

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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen