首页 文章

AWS API Gateway - 多个阶段

提问于
浏览
0

我有一个使用API Gateway,Lambda和DynamoDB的简单AWS实现 . 我注意到AWS API Gateway允许多个阶段 . 在阅读了一些docs并使用配置后,对我来说,如何能够创建可以指向新lambda函数的新 endpoints 并不明显 .

我当前的 endpoints 是这样的:

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函数 .

这怎么可以做到?

1 回答

  • 1

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

    这将是您创建prod的步骤 .

    你肯定会使用两个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...
    

相关问题