Micro-Services with AWS Lambda and API Gateway — Part 3
For this part we’re going to learn about the API Gateway service and how to turn our HTTP requests into the JSON events which our Lambda function can consume and act upon.
Creating a new API
Firstly we set up a new API from the AWS console. We should already have the Lambda function set up from the previous part of this tutorial so we only need to create a resource to interact with it.

So let’s get started by choosing a name.

This is our new API’s console, now we can click on Create Resource.

For the moment we should just call this resource demo and give it that resource path.

Now we can add the method from clicking the Create Method button.

We can them simply select the GET option for our first test.

We’ve got our GET method set up so now we can apply the Lambda function to our endpoint.

Ok, we should get our layout for the execution of the API method.

Finally all we need to do is just click Deploy API and create the new staging environment. For the sake of them I’ve just called it prod.

Now our production environment is done we’ll be able to make a quick request using a RESTful client. As you can see on our next screen we’ve got a working url for our API.

The next step is to copy it to our client and hopefully receive the correct response we see below.

What now?
So we haven’t done a great deal of work in this step but it’s the basics of our API. Currently we don’t have any authentication and just a single endpoint that provides the same data on each request. Our next step is to develop a real service that can consume headers, parameters and message bodies.