【问题标题】:AWS API Gateway - multiple stagesAWS API Gateway - 多个阶段
【发布时间】:2017-07-25 04:31:14
【问题描述】:

我有一个使用 API Gateway、Lambda 和 DynamoDB 的简单 AWS 实施。我注意到 AWS API Gateway 允许多个阶段。在阅读了一些 docs 并尝试了配置之后,我不清楚如何创建可以指向新 lambda 函数的新端点。

我当前的端点是这样的:

https://xxx.execute-api.us-east-1.amazonaws.com/prod/my-mymethod

我正在寻找类似的东西:

https://xxx.execute-api.us-east-1.amazonaws.com/stage/my-mymethod

这将指向一个独立的 Lambda 函数。

这究竟是怎么做到的?

【问题讨论】:

    标签: amazon-web-services lambda aws-api-gateway


    【解决方案1】:

    http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-lambda.html

    这与您创建产品所采取的步骤相同。

    您肯定会使用两个 lambda 函数,因为它是模块化的,您对原始 Lambda 的更改将反映在两者上。

    1.Create Lambda Function
    2.Create API in API Gateway
     2a Create New, 
     2b Click Actions > Create Method > Choose HTTP Method
     2c Whilst HTTP Method is highlighted set "Integration type" to Lambda Function
     2d Choose Lambda Region where your Lambda Function exists
     2e Intellisense will help you fill in the name...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-12
      • 2020-04-30
      • 1970-01-01
      • 2017-01-24
      • 2015-10-28
      • 2022-10-03
      • 2021-01-29
      相关资源
      最近更新 更多