1
00:00:03,090 --> 00:00:09,390
So let's understand what all these options on the left here do, specifically usage plan and so on

2
00:00:10,290 --> 00:00:14,520
For usage plan API keys, to understand these menu items,

3
00:00:14,520 --> 00:00:18,760
it's important to understand how your API may be used.

4
00:00:18,870 --> 00:00:24,510
You can create your own API for your own applications, like we do in this course.

5
00:00:24,630 --> 00:00:25,900
We have some web app,

6
00:00:25,980 --> 00:00:31,140
we will have one at the end of the course with which we want to connect to a back-end because our web

7
00:00:31,140 --> 00:00:33,320
app happens to be a single page application,

8
00:00:33,420 --> 00:00:37,530
so it runs on a static server, executes no server-side code,

9
00:00:37,530 --> 00:00:43,870
so we need a back-end to connect to to store data in a database, fetch data and so on.

10
00:00:43,890 --> 00:00:51,000
Now if we have our own API with our own front-end, API keys aren't really interesting to us because we control

11
00:00:51,000 --> 00:00:57,240
everything. We create that API, we deploy it on a stage here and we get this URL which we can use

12
00:00:57,240 --> 00:00:59,040
in our own application.

13
00:00:59,040 --> 00:01:04,220
Now theoretically if other people were to inspect the source code of our app, they could steal this URL

14
00:01:04,230 --> 00:01:09,870
and they could try using it on their own but that wouldn't really help them because the API is only

15
00:01:09,870 --> 00:01:13,480
used by us and therefore, pretty much suited to our application

16
00:01:13,620 --> 00:01:18,090
and if we use authentication which we probably do and we will learn about this in this course, there's

17
00:01:18,090 --> 00:01:20,210
even less people can do with that link.

18
00:01:20,550 --> 00:01:27,390
Now API keys are interesting if you plan on creating an API which is shared with other developers,

19
00:01:27,390 --> 00:01:34,510
so not with users of your app but with other developers creating their own apps.

20
00:01:34,530 --> 00:01:36,600
Think about the Google Maps API,

21
00:01:36,870 --> 00:01:41,480
they have an API where you can send coordinates and get back address information.

22
00:01:41,760 --> 00:01:47,770
Now if you want to use that, you have to register on Google and you will get an API key by them.

23
00:01:48,110 --> 00:01:54,460
It's that key which you then have to pass with any request you send to the API because you identify yourself

24
00:01:54,540 --> 00:01:55,440
with that key

25
00:01:55,530 --> 00:02:00,720
and Google can also track your usage of the API and possibly limit you if you exceed your limits or

26
00:02:00,720 --> 00:02:01,990
anything like that

27
00:02:02,270 --> 00:02:04,650
and you can do the same here in API Gateway.

28
00:02:04,650 --> 00:02:11,190
You can create API keys here, sign them any customer name and of course, there are also ways of automatically

29
00:02:11,190 --> 00:02:15,940
generating them if you have like an automatic system where people can register for your API

30
00:02:16,140 --> 00:02:22,830
but let's do it manually and you will get such an API key then, here. That's just a random key and the

31
00:02:22,830 --> 00:02:29,090
customer for which you generated the key can now send to this key with requests to identify themselves,

32
00:02:29,100 --> 00:02:34,490
Ww'll soon learn that you can indeed block requests which are sent without API keys.

33
00:02:34,530 --> 00:02:41,940
You can even set up usage plans to restrict the usage of your API by certain keys,

34
00:02:42,090 --> 00:02:47,750
so you could assign a usage plan to this API key and say you are only allowed to access my API, let's

35
00:02:47,820 --> 00:02:51,980
say 1000 times per second, per minute or anything like that.

36
00:02:52,020 --> 00:02:55,100
This is what you can do with API keys and usage plans,

37
00:02:55,140 --> 00:02:59,680
it's important if you plan on exposing your API to other developers,

38
00:02:59,760 --> 00:03:05,790
it's not important if you do what we do in this course and you use your API only on your own.

39
00:03:05,910 --> 00:03:07,920
Now what about the other options?

40
00:03:08,220 --> 00:03:14,040
If you have a look at custom domain names or specifically if you have a look at the domain our first

41
00:03:14,040 --> 00:03:15,530
API is hosted on,

42
00:03:15,720 --> 00:03:21,030
it should be pretty clear what custom domain names does. It allows you to connect your own domain which

43
00:03:21,030 --> 00:03:29,280
you own to your API, so that you don't have these generic AWS URL which works fine but your own

44
00:03:29,370 --> 00:03:34,500
domain, which might especially be important if you do indeed plan to expose your API to other developers

45
00:03:34,500 --> 00:03:36,870
too. Client certificate is

46
00:03:36,880 --> 00:03:42,690
important if you plan on forwarding incoming requests to yet another HTTP endpoint

47
00:03:42,870 --> 00:03:50,130
and on that other HTTP endpoint, you want to validate that the request this endpoint gets indeed

48
00:03:50,130 --> 00:03:53,160
stems from your API Gateway API

49
00:03:53,430 --> 00:04:00,210
and with a client certificate, you can generate a certificate which proves this to your final API

50
00:04:00,210 --> 00:04:02,580
endpoint on a different API,

51
00:04:02,790 --> 00:04:08,690
not something we'll look into this course. And on settings, you can simply manage the roles, the

52
00:04:08,730 --> 00:04:16,680
permissions this service has because keep in mind, by default, each AWS service has no permissions at

53
00:04:16,680 --> 00:04:17,210
all,

54
00:04:17,250 --> 00:04:21,220
you have to give permissions so that the services are able to do something

55
00:04:21,330 --> 00:04:27,240
and if you want to generate log files for API Gateway for example, you would have to give it the

56
00:04:27,300 --> 00:04:29,970
right permissions and you can do that here.

57
00:04:30,360 --> 00:04:31,770
So that's the options here,

58
00:04:31,890 --> 00:04:35,160
not something we will work on in this course. For us,

59
00:04:35,160 --> 00:04:38,750
the API specific items here are more interesting.

60
00:04:38,880 --> 00:04:44,200
So let's dive into that and understand how an API really works in a high level in the next lectures.
