gpt4 book ai didi

aws-lambda - 在 SAM json 中将授权者添加到 api 网关

转载 作者:行者123 更新时间:2023-12-03 07:41:48 25 4
gpt4 key购买 nike

我有这个 SAM:

"ApiGatewayApi":
{
"Type": "AWS::Serverless::Api",
"Properties": {
"StageName": "Prod",
"Name" : "MainGateway",
"Cors": {
"AllowMethods": "'POST, GET, PUT, DELETE'",
"AllowHeaders": "'access-control-allow-headers,access-control-allow-methods,access-control-allow-origin,authorization,content-type'",
"AllowOrigin": "'*'",
"MaxAge": "'1'"
}
}
},

我尝试添加这样的授权者:

"RESTAuthorizerGeneral":
{
"Type" : "AWS::ApiGateway::Authorizer",
"Properties" : {
"Name" : "HTTPAuthorizer",
"Type" : "TOKEN",
"IdentitySource" : "method.request.header.Authorization",
"RestApiId" : {"Ref": "ApiGatewayApi"},
"AuthorizerUri" : ""
}
},

1 - 我收到此错误:ApiGatewayApi 对于此引用来说是无效类型。

2 - 如何填写“AuthorizerUri”字段?

最佳答案

关于aws-lambda - 在 SAM json 中将授权者添加到 api 网关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65565054/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com