http authorizer lambda permissions

0

【以下的问题经过翻译处理】 我通过CDK创建了一个HttpAuthorizer,并将其附加到lambda函数的authorizer上,但我不知道如何允许API gw调用我的lambda authorizer。

在控制台上,我们有选项:“automatically authorize API gw to call your function”,我甚至创建了一个API角色并赋予权限来调用我的Lambda authorizer,但没有办法将其链接到HttpAuthorizer。

有没有类似布尔值的方式来启用API gw调用我的Lambda authorizer或者直接将API角色连接到HttpAuthorizer?

1개 답변
0

【以下的回答经过翻译处理】 我使用下面的链接解决了问题:

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

我需要创建一个Lambda授权者的权限,并手动构建源ARN:

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}`,

profile picture
전문가
답변함 6달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠