In this video, Jeff Winesett creates a new lambda function and uses Amazon Gateway API as the event source to invoke the function. AWS Lambda and Amazon gateway API allow for serverless microservice application architectures.
- [Instructor] This serverless application that I'm building is a pretty simple one. It's basically going to take some information and store it in a DynamoDB table, and then pull that information back out and display it. Pretty simple. It's basically got a front end part, it's got an API, that it's a Lambda function, that in then turn saves data to a DynamoDB. So now I'm going to create the Lambda function part of that architecture. So I'm going to go to the service Lambda, right there, right off the bat, type an L.
And, of course, I haven't done anything with Lambda in this account yet, so I'll click Get Started Now. It's giving me the option here to choose from an existing pre-configured blueprint and blueprints are sample configurations of event sources and Lambda functions. There are many from which to choose and they cover many different scenarios. There is a blueprint called microservice-http-endpoint, which is exactly the scenario I need. It configures API Gateway as a trigger for a Lambda function and manages the create, read, update, and delete operations on a DynamoDB table.
And that's exactly what I want to do. So let me find that. Let me Filter by microservice, there it is, microservice-http-endpoint. Let me click on that. So this particular blueprint automatically assumes using the API Gateway as the trigger. The default API name created is LambdaMicroservice, which I can change. I'll just call this jeff-demo - microservice.
The Deployment stage here is not production, I'm just doing a test, so I'm going to call this test. Test deployment. And for this particular demo I want this to be Open, I don't need any sort of access control on the gateway. I want it to just be wide open for anybody from the internet to hit. Of course, it gives me a warning, your API endpoint will be publicly available and can be invoked by all users. And that's exactly what I want. Click Next. And next, I configure the Lambda function.
I'm going to give it a Name, let me call it dynamoDBCRUD, for create, read, update, and delete. That's exactly what it's going to be doing. The default Description's already appropriate for our needs. The Runtime's already configured, I'll leave that be. And I see the function is already provided for me, it's already using Node.js to create a basic read, write, update, and delete against a DynamoDB table.
And, of course, this allows me to edit it right here if I needed to. I'm not going to make any changes at this moment. And there are several other available options that I could set down here. We could set some Environment variables to be passed in and some other settings, but I don't need to change any of this for now. Can leave all of this as-is. Okay, I do need to give it a Role name, I overlooked that. The policy's already chosen for me, but I'll call this something that I would know if I went to IEM and be able to see it. I'll do lambda-function-role, that'll tell me something right now.
Click Next. I get a chance to Review. And click Create Function. Okay, great, it tells me Congratuations, my Lambda function dynamoDBCRUD has been successfully created and configured. At this point it does allow me to Test the function out, but because it's doing create, read, and update, delete functions against a DynamoDB table I really need to set up a DynamoDB table first. So let's do that. That's going to be the focus of the next video.
- Benefits of cloud services
- Making architectures scalable
- Examining cloud constraints
- Virtual servers, EC2, and Elastic IP
- Using the Amazon machine image
- Elastic load balancing
- Using CloudWatch for monitoring
- Security Models
- Elastic block storage
- S3, CloudFront, and Elastic Beanstalk
- Handling queues, workflows, and notifications
- Caching options and services
- Identity and access management
- Creating a custom server image
- Application deployment strategies
- Serverless architectures