put*_*tra 5 amazon-web-services aws-api-gateway serverless
我在 API 网关端点上附加自定义授权者时遇到问题。这是我的场景步骤:
\n\n如何将自定义授权者附加到无服务器 yaml 上?
\n\n有人可以帮助我吗?
\n\n\n\n\n小智 1
您应该首先创建授权者。您将获得一个授权者 ID,可以在您的配置中使用。
Resources:
authorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
AuthorizerResultTtlInSeconds: 0
AuthorizerUri: !Join
- ''
- - 'arn:aws:apigateway:'
- '{region}'
- ':lambda:path/2015-03-31/functions/'
- 'arn:aws:lambda:{region}:'
- Ref: AWS::AccountId
- ':function:customAuthorizer'
- '/invocations'
Name: authorizer
RestApiId: {restApiId}
Outputs:
authorizerId:
Description: "API Gateway Auth Id"
Value: !Ref authorizer
Export:
Name: !Join
- '-'
- - !Ref AWS::StackName
- AuthorizerId
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5291 次 |
| 最近记录: |