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 Respuesta
0
Respuesta aceptada

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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas