Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lambda microservice #5

Merged
merged 2 commits into from Jan 12, 2021
Merged

add lambda microservice #5

merged 2 commits into from Jan 12, 2021

Conversation

svozza
Copy link
Owner

@svozza svozza commented Jan 11, 2021

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 called serverless-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 the AWS::ApiGateway::Method construct is ANY, 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 level services 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.

Copy link

@BastLeblanc BastLeblanc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants