Improve RestApi for stages and aliases #237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The possibility to have different lambda functions depending on REST API methods doesn't integrate well with the current way of defining stages and lambda aliases.
As each stage is defined once, the stage variables must be the same for all methods and all lambda functions. So if there is a stage variable pointing to a lambda alias, it must be the same for all lambda functions.
Hence a change is made to Alias so that the resource name can be different from the alias name, and multiple lambda functions can share the same alias name.
Then the possibility to define an integration uri at the resource level is added so that each resource can point to a different lambda function while still referencing the stage variable containing the alias name.
Finally, the possibility to define the lambda ARN for the InvokeFunction permission at the resource level, and per stage, is added to make it possible to give the right permissions for each resource and stage.
Simplify test_rest_api_nested_resources as there is now test_rest_api_multi_lambdas_stages