相关疑难解决方法(0)

Shared Lambda authorizer setup in Serverless Framework

I am trying to create a custom Lambda authorizer that will be shared between a few different services/serverless stacks. If I understand the documentation here https://serverless.com/framework/docs/providers/aws/events/apigateway/#note-while-using-authorizers-with-shared-api-gateway, that means that I need to create a shared authorizer resource in a “common resources” service/serverless stack, and then refer to that shared authorizer from my other services. First of all: Is my understanding correct?

If my understanding is correct, my next question becomes: How do I do this? The documentation doesn’t provide …

amazon-web-services serverless-framework

7
推荐指数
1
解决办法
4949
查看次数

API 网关 HTTP 代理与无服务器离线集成(不是 Lambda 代理)

我正在尝试使用无服务器离线在本地开发/模拟我的 API 网关。我的 API 网关自由地使用了HTTP 代理集成。生产资源如下所示:

API 网关资源方法上的 HTTP 代理集成的屏幕截图

我根据一些文档和讨论创建了一个无服务器离线配置,这些文档和讨论表明可以使用 Cloud Formation 配置定义 HTTP 代理集成:

我已根据我的目的改编了上述两个配置示例,请参见下文。

有什么提示,我可能在这里做错了什么?

plugins:
  - serverless-offline

service: company-apig
provider:
  name: aws
  stage: dev
  runtime: python2.7

resources:
  Resources:

    # Parent APIG RestApi
    ApiGatewayRestApi:
      Type: AWS::ApiGateway::RestApi
      Properties:
        Name: company-apig
        Description: 'The main entry point of the APIG'

    # Resource /endpoint
    EndpointResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId:
          Fn::GetAtt:
            - ApiGatewayRestApi
            - RootResourceId
        PathPart: 'endpoint' …
Run Code Online (Sandbox Code Playgroud)

aws-api-gateway serverless-framework serverless serverless-offline

5
推荐指数
1
解决办法
2113
查看次数