- [Wes] Welcome back. I'm Wes, and in this section we will introduce Amazon API Gateway. We're going to do a quick overview of what the service is all about. We'll talk about why you would want to use it, and then we'll run through a quick demo to show you how to create and configure your very own API gateway in the AWS console. Let's get started. So API Gateway is a fully managed service that's designed to make it easy for developers to create, publish, maintain, and monitor secure application programming interfaces, or APIs, at any scale. With a few clicks in the AWS Management Console, you can create REST and WebSocket APIs that act as a front door for your applications to access data, business logic, or other functionality from your backend services. Like workloads, running on EC2, and web applications. API Gateway also provides an easy interface for code running on AWS Lambda and other AWS services, which we'll discuss in detail later in this course. First off, why would you want to use API Gateway? Well, turns out that software development organizations are moving more towards microservice architectures. Microservices are an approach to software development where software is composed of small independent services that communicate over well-defined APIs. These services are - in turn - owned by small, self-contained teams. Microservices architectures make applications easier to scale and faster to develop. And that really enables innovation and accelerates the time-to-market for new features. API Gateway fits right into this scheme. So, why would you want to use it? Well, developers can add headers, map input variables from POST events, to something your target application needs. You're going to see this in the demo in a minute, as well as later in this course. Here are several more reasons you might want to use API Gateway. Efficient API development: You can run multiple versions of the same API simultaneously with API Gateway. This allows you to quickly iterate, test, and release new versions. We're talking about the difference between days and weeks. Easy monitoring: You can monitor performance of metrics and information - on API calls, data latency, error rates - from the API Gateway dashboard, which allows you to see millions of requests in a single pane of glass. Performance: You can provide end users with the lowest possible latency for API requests and responses, by taking advantage of our global network of edge locations using Amazon CloudFront. You can also throttle traffic and cache the output of API calls, to ensure that the backend operations withstand traffic spikes, and backend systems are not unnecessarily called. Cost savings: API Gateway provides a tiered pricing model for API requests. You can decrease your costs based on the number of API requests you make, per Region, across your AWS accounts. Flexible security controls: You can authorize access to your APIs with AWS Identity and Access Management, or IAM, as well as Amazon Cognito. If you use OAuth tokens or other authorization mechanisms, API Gateway can help you verify incoming requests as well. By providing an extra layer in front of your backend service, you can add extra layers to protection and security as well. So enough marketing speak. Let's crack open the AWS console, and show you how this thing works. So in this demo, we're going to log in to the AWS console, go to the API Gateway service, and get started. So, a little note there about an example API that's already set up for you. However, we're going to create a new API by selecting New API. We're going to give it a name. In this case, we're just going to use "demo." The description itself is optional. Then we hit the Create API button. In our Actions, we're going to create, first, a new method. And for this particular demo, we're going to make it real simple, and we're just going to use a GET request. As part of this GET request, since this is just a demo, we're not actually going to do anything. We're going to use for the integration method we're going to use mocking. And what mocking really is, it's just a fake way to send some information and bounce it back without actually making anything happen. So, we haven't written any code, we don't really have a service, but we want to test that the API Gateway works. So, in this particular case, we have created our Method Request. We've decided that our Integration Request type is going to be MOCK, and again that's just for fake. So the next thing we have to do is the Integration Response. And the way we do that, is selecting Integration Response, we're going to scroll down to expand this, and we're going to simply use a mapping template that's already been created for us, application/json. And the little dropdown here, we've got our method passthrough. This code's not super important, but all it really does, is bounces back any request that's sent to it with all new information that's coming through in the header within the request. Check it out. We save our particular request, and now we are going to deploy it. Go back to Actions, and hit Deploy API. We're going to give this stage a name, in this case we're just going to call it "test." Call a new stage, we're going to call it "test," And we don't have to give it a description. As you'll see, since I've created this, we now have a URL. I can click on this URL to test my API. All we've done is gone out, we've taken all the information that came from that particular request, the header itself. And you can see all kinds of information in the query string that was just returned. All the variables, my IP address and all the browser information that was returned. It's really just that simple.