-
Notifications
You must be signed in to change notification settings - Fork 0
6. Create an API in AWS API Gateway
Vikas Rathod edited this page Feb 21, 2021
·
2 revisions
- Login into your AWS Management Console.
- Make sure your in
Canada (Central) ca-central-1
region - Go to
Services
, and openAPI Gateway
under Networking & Content Delivery section. - Go to
REST API
and Click onBuild
- Select
New API
radio button. - Enter
postAPI
as API name (You can give any name) - Make sure your Endpoint Type is
regional
- Click on
Create API
- Select
- Now Click on
Actions
and selectCreate a Resource
- Keep
Configure as proxy reosource
as Unchecked. - Enter
postdata
as Resource name - Check on
Enable API Gateway CORS
and click onCreate Resource
. - Select
OPTIONS
method from newly appeared option underpostdata
resource. - Click on
Integration request
. - Now keep
Lambda Function
as integration type - Mark as checked to
Use Lambda Proxy integration
option. - Keep Lambda region as
ca-central-1
- Enter
postDynamo
as Lambda Function - Click on
Save
If you've gave any different name while creating a Lambda function then you should give that specific name
- Click
OK
on appeared INFO popup.
- Keep
- Now you've created a API to do communication with you Lambda function. But we still need to deploy it. So
- To deploy this API click on
Actions
and selectDeploy API
- Go to Deployment Stage and select
[New Stage]
. - Enter
production
as a stage name. - Feel free to add stage description and deployment description of your choice.
- Click on
Deploy
.
- To deploy this API click on
- Now you've deployed the API in production stage.
- To integrate it with our use-case we need
Invoke URL
of specific Resource which ispostdata
in our case. - So Click on drop down symbol beside
production
stage. - Select
OPTIONS
method and look forInvoke URL
.
- To integrate it with our use-case we need
MOST IMP: Now copy your
Invoke URL
and paste it in Notes.