【发布时间】:2021-01-01 00:24:19
【问题描述】:
我有这个资源:
"MyUserAuthorizer": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "MyProject::MyProject.Functions::UserAuthorizer",
"Runtime": "dotnetcore3.1",
"CodeUri": "",
"Description": "authorizer",
"MemorySize": 256,
"Timeout": 30,
"Role": null,
"Policies": [
"AWSLambdaFullAccess"
]
}
}
我想添加一个将使用此 MyUserAuthorizer lambda 的 AWS::ApiGateway::Authorizer 资源。 我试过这个:
"Auth": {
"Type" : "AWS::ApiGateway::Authorizer",
"Properties" : {
"AuthorizerCredentials" : null,
"AuthorizerResultTtlInSeconds" : 300,
"IdentitySource": "method.request.header.Authorization",
"Name" : "Auth",
"Type" : "TOKEN"
}
}
, 如何将其连接到 lambda 授权函数? 我在 json 中只有其他 lambda 函数。我应该有 api 网关定义吗? 如何为所有 lambda 函数添加 CORS 支持?
【问题讨论】:
标签: amazon-web-services aws-lambda amazon-cloudformation