2017-07-24 38 views
0

我有一個簡單的AWS實現,使用API​​ Gateway,Lambda & DynamoDB。我注意到AWS API網關允許多個階段。在閱讀了一下docs並且隨着配置的變化,對我來說,我怎麼能夠創建可指向新的lambda函數的新端點並不明顯。AWS API網關 - 多個階段

我現在的終點是一樣的東西:

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

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