AWS_Session_4_14-06-2023
AWS_Session_4_14-06-2023
AWS Session
Summary 14-06-2023
● API gateway is helping the user reach the final destination. It’s providing an
interface, a kind of door to the final application. Hence, it is called API,
Application Programming Interface. API gateway server can be set up
and launched on the cloud by using AWS API Gateway.
➢ Whenever you type google.com, you hit the API Gateway running in
Google’s server.
➢ The default rule always takes the user to /search, if /path is not
specified. www.gmail.com is converted to www.google.com/mail in
background.
➢ Click Create function. Give Function name as searchfunc and set Runtine
to Python 3.0
➢ Create another function having the name mailfunc and set Runtine to Python
3.0
● These functions will be running your private AWS account. To give outside
people access to it, we will set up API Gateway.
➢ In the Settings bar, set the API name as myApiGateway. Click Create API
button.
● API will manage for you the hardware, networking, route, and public IP
address. It can also manage the load by scaling the servers in times of
incoming of sudden traffic. It is highly scalable with good performance.
● EC2 service is an on-demand service and charges you for the number of
computers you launch even when there is no traffic on your web app.
● API Gateway charges you per request wise. Hence, saves cost as well.
➢ First click the “/”, then create another resource with the Resource name as
mail.
Protocol: http/https
Url
Route: /path
● The Gateway will respond to a request only when the route and the verb
match that of an existing Lambda function.
➢ Click on /mail > Actions > Create Method > select GET
➢ Click on /search > Actions > Create Method > select GET
➢ Select Action > Deploy API > Give Deployment stage and Stage name >
Deploy
➢ Save Changes
● The API Gateway server is not running yet. But as soon as a client hits its
URL using either /mail or /search paths, the server will start running and
give output. This model is called pay-as-you-go. It is highly scalable and has
optimized performance. It is very cost-effective as well.