【发布时间】:2021-04-10 09:16:23
【问题描述】:
我有这个 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 amazon-cloudformation aws-api-gateway aws-serverless