1
00:00:00,330 --> 00:00:02,910
In this video I'm going to show you.

2
00:00:02,910 --> 00:00:05,550
And another way to create rest API.

3
00:00:05,580 --> 00:00:12,120
We will create rest API from the lambda function with adding the API gateway trigger.

4
00:00:12,630 --> 00:00:17,850
So this is the shortcut of creating API gateway and lambda function with a console.

5
00:00:18,150 --> 00:00:23,070
Let's open the console and create a new function.

6
00:00:23,910 --> 00:00:26,190
For example, let's say taste function.

7
00:00:28,340 --> 00:00:29,720
Create a new function.

8
00:00:31,830 --> 00:00:40,050
And this time we will create rest API from the lambda function itself with adding the API gateway trigger.

9
00:00:40,200 --> 00:00:47,400
As you can see that there is a there is a window that we can see lambda function, name layers, tickers

10
00:00:47,400 --> 00:00:48,590
and destinations.

11
00:00:48,600 --> 00:00:52,460
So this time I'm going to create a rest API from the lambda function.

12
00:00:52,470 --> 00:00:55,260
We are not going to create from the API gateway.

13
00:00:55,290 --> 00:00:58,860
We will create this API in this window with adding the trigger.

14
00:00:58,890 --> 00:01:05,580
Click a trigger button and see that lambda function can be triggered different resources.

15
00:01:05,580 --> 00:01:08,820
So this time I'm going to create an API gateway trigger.

16
00:01:08,850 --> 00:01:13,830
So this will be the rest API and we can create a new API.

17
00:01:13,860 --> 00:01:18,600
We can see that we can choose API, type in here, http and rest api.

18
00:01:18,630 --> 00:01:20,850
I would like to choose rest api.

19
00:01:20,970 --> 00:01:25,410
I don't set any security so that's why we should set the open.

20
00:01:25,410 --> 00:01:30,480
And if you would like to set additional settings, you can change this configuration.

21
00:01:30,480 --> 00:01:34,470
Also, I'm not going to change any configuration and click to add button.

22
00:01:34,560 --> 00:01:41,940
So this will create an rest API gateway into the API Gateway section and this will trigger our test

23
00:01:41,940 --> 00:01:43,770
function to do so.

24
00:01:43,770 --> 00:01:46,790
You can check the Lambda Configurations.

25
00:01:46,800 --> 00:01:52,350
If you come to configurations and come to triggers, you can see the API gateway issue, right click

26
00:01:52,350 --> 00:01:53,640
and open it up.

27
00:01:53,670 --> 00:01:57,120
You can see the API gateway definition on the API gateway page.

28
00:01:57,120 --> 00:02:03,360
So basically it is create a test function and any method and this will be lambda proxy.

29
00:02:03,360 --> 00:02:11,370
And in this request directing to the lambda test function all configuration handled by the A with adding

30
00:02:11,370 --> 00:02:13,410
trigger to our lambda function.

31
00:02:13,410 --> 00:02:17,070
You can see this stage, there is a default stage and test function.

32
00:02:17,070 --> 00:02:24,240
Handle all the exit method because the resource definition with any OC as you can see that we can see

33
00:02:24,240 --> 00:02:31,170
the triggers and you can check the URL API and point in here and also check from the API gateway states.

34
00:02:31,170 --> 00:02:37,500
So for example, come to Lambda function and if you expand the database you can see the test also.

35
00:02:37,500 --> 00:02:46,170
So if you right click and open it up, you can directly invoke lambda function from the rest API gateway.

36
00:02:46,200 --> 00:02:53,740
This is the shortcut of how we can create rest API over the API from the lambda function when we select

37
00:02:53,740 --> 00:02:55,290
trigger to the lambda function.
