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.
Description of changes:
This adds a template for the recipe lambda service and is written in a way that it should be easy to add further lambda microservices using the same templates.
The main section to pay attention to is in the
aws/cloudformation-templates/services
folder. There is now a new directory calledserverless-service
that contins an_template.yaml
file. This template defines the lambda function and API Gateway resources for the particular microservice. The HTTP verb given to theAWS::ApiGateway::Method
construct isANY
, which means the lambda function must inspect the event it receives and do the appropriate action depending on what verb it has received. I envisage a lambda function per resource path so all the logic for recipe microservice will be available at the/recipe
path.I have also created a new
role.yaml
template in the top levelservices
directory: the current way roles are handled violates the Principle of Least Privilege (I've created an issue with more information here: aws-samples#184) so I don't want to follow what is done for the Docker services. I have also enabled Cognito authentication so the microservice is secure by default.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.