Amazon Web Service (AWS) is the Amazon’s version of on-demand cloud platform and APIs. Amazon EC2 is one of the most popular cloud computing services through dynamic provisioning of virtual servers. But there’re other AWS services, in fact, hundreds of them covering analytics, ML, AR, VR, networking, database, security, and hosting, etc.
When you are just starting the Cloud journey with AWS, it can be overwhelming. Where could you start?
One of the starting point that I found useful is to follow this step-by-step Amazon Example “Build a Serverless Web Application”. In fact, I had included this as one of the on-boarding tasks for my new team members when I was at Amazon. This example is simple to follow. It touches many important concepts such as IAM role, policy as well as several important AWS services such as S3, DynamoDb, API gateway, Lambda.
I hope you will have fun going through this exercise and able to “Request Unicorn” when you complete the exercise :-)
I am also including here a few minor issues I noticed in the above documentation. Module 4 “Deploy a RESTful API”, step 3 “Create a new resource and method”, you need two additional steps
- Enable CORS
Even though you might already clicked the checkbox “Select Enable API Gateway CORS” when creating the resource, CORS is actually still not enabled (not sure if this is a bug). You need to click Enable CORS from the Actions drop-down list and follow this instructions after the creation of the resource.
2. Enable Lambda Proxy
Click the checkbox in Resources/POST/IntegrationRequest. This allow add the RequestContext to be added as part of the event that Lambda function receives. This RequestContext was used inside the lambda function defined in Module 3/Step 3 of the example problem. Without Lambda Proxy, your web app will throw exception accessing /ride.html to “Request Unicorn”