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 Risposta
0
Risposta accettata

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
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande