So we created this first API in our first module of this course,
now what do we have here, what are all these menu items on the left about
and how does this API actually work?
If you remember the first module, what we did is we clicked actions, create resource and then create method
to create this resource and this method.
If we check out this method, we see this strange thing on the right,
I'll come back to this. For now I want to focus on what we did,
we worked here under resources, we clicked create method resource and so on and as you can see, we
got a lot of different actions.
So under resources, we indeed managed the resources and methods of our API
and important, resource, a resource is just like a path like this,
so if you create a new resource, you create a new path in the final URL you can use.
There is one important application.
I said we do work here, we do add new resources and methods
and this of course also has to mean that whatever we do here in resources isn't live,
this isn't our live API. To bring it to life and expose it to the web,
we always have to call deploy API here. Until we do that, all our changes here will not be reflected in
the web,
once we do that, we have to select the stage
and this brings us to stages. Stages are like snapshots of your API, deployed snapshots.
You work under resources and you manage all your resources there
but if you decide, yes I get a state which I now want to use in production or at least for development, for
testing, you have to deploy it and then basically a snapshot of your API is taken and is shipped to the
web
and you can view all your stages here. You can have multiple stages,
one for development, one for production, one for version one, one for version two, whatever you want
and here you can't edit the API and
that is why this looks different.
Instead the only thing you can do here is basically check out the link you get and use that,
so you get some information about that deployment but the actual work happens under resources.
Now what's authorizers, models and so on about? Authorizers allows you to add authentication to your API.
So if you have certain resources, paths which should only be accessible by users who are logged in,
are somehow authenticated to you, you can define this authentication logic or the tool, the code
you want to use for authenticating users here because of course API Gateway needs to know on how you
authenticate users, what authenticated means in your world and you can add such authorizers
and if this sounds confusing, no worries, I got a whole section in this course about authentication with AWS
Cognito and you will see, it's super easy to add authentication in the end. Models allows you to define
the shape of the data you work with in your API.
It's optional,
you don't have to use that feature at all.
Models are actually created using the JSON schema language,
so you define how the actual JSON data your API receives should be structured
and if you do set up models here and you will also do this later in the course, you can use these
models to validate incoming data, see if it fits that schema, reject that if it does not and use the model
in some other useful places,
so that's really nice too. Documentation is also important if you plan on exposing your API to other developers.
You can then document it and make sure that people know how to use your API, which data to send and which
data to expect as a response. Binary support is important if you plan on sending files along with your requests.
To send these files unchanged to the receiving endpoint or to the code which actually handles the request,
you have to register the file types you want to forward here. And dashboards gives you some logging about
the API,
you can see the usage or errors which were thrown, so on a high level, you can see how your API
performs and works.
This is the high level overview but there is one big thing which might be very confusing and this is
this part on the right here, I'm under resources and selected a method,
what is this about?
It's about how API Gateway works behind the scenes.
So let's take a closer look in the next lectures.