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 个月前

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

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

回答问题的准则