如何解决AWS ApiGateway API 密钥源 YAML
我无法在 API Gateway 中找到此特定值的正确配置:
我使用 AWS SAM 进行部署。这是我在 YAML 中的堆栈的一部分,主要是 API 网关定义:
Resources:
OrdersApi:
Type: AWS::Serverless::Api
Properties:
Name: Orders API
StageName: !Ref Environment
BinaryMediaTypes:
- 'application/pdf'
MethodSettings:
- LoggingLevel: ERROR
ResourcePath: '/*'
HttpMethod: '*'
DataTraceEnabled: true
MetricsEnabled: true
Cors:
AllowMethods: "'GET,OPTIONS,POST'"
AllowHeaders: "'*'"
AllowOrigin: "'*'"
Auth:
Authorizers:
LambdaRequestAuthorizer:
FunctionPayloadType: REQUEST
FunctionArn: !GetAtt Auth.Arn
Identity:
Headers:
- access_token
...
如何在我的 SAM/Cloudformation 模板中设置 Api Key Source 类型?文档提到了 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-apikeysourcetype,但这需要我完全更改我的资源类型以符合 Open API 规范,而我只想在部署我的 API 时将该值设置为 AUTHORIZER。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。