Skip to main content

 

How to Configure AWS service API Gateway


Hi Folks, 

πŸ™ Namaste and Welcome to my blog πŸ™

Hope this finds you safe and healthy! 

Today I will explain "How to Configure AWS service API Gateway" . Below are the steps which I will take during this session. 

1) Briefing about API Gateway 
2) Costing 
3) Create API Gateway 
4) Configuration 
5) Code location on web server 



1) Briefing about API Gateway

Amazon API Gateway is an AWS service for creating, publishing, maintaining, monitoring, and securing REST, HTTP, and WebSocket APIs at any scale. API developers can create APIs that access AWS or other web services, as well as data stored in the AWS Cloud. As an API Gateway API developer, you can create APIs for use in your own client applications. Or you can make your APIs available to third-party app developers.





2) Costing

A) Free Tier

The Amazon API Gateway free tier includes one million API calls received for REST APIs, one million API calls received for HTTP APIs, and one million messages and 750,000 connection minutes for WebSocket APIs per month for up to 12 months. If you exceed this number of calls per month, you will be charged the API Gateway usage rates.

B) Now for detailed view https://aws.amazon.com/api-gateway/pricing/ please go to AWS link which will give you pricing in detailed as I cannot give pricing for each region here πŸ˜‰.

3)  Create API Gateway

  •   Go to AWS console and type AWS API Gateway in search 


  • Click on Create API

  • I will create Rest API (HTTP API)


4)  Configuration
  • Now Add name for your API in box shown below and the click on next
  • Next on configure section click on next you can configure it later

  •  On define stages you can use default stage as I am using default else you can create stage for yourself
  • Review and create section click on create (excuse me for editing please) I have painted out all api gateway name but for your case you can api gateway name here only.


  • Now we will configure routes for our API, click on your api gateway name in front page (as shown in above screen shot)

  • Next you will get screen like below and then click on routes in left side as shown

  • Now click on create route and choose ANY and give name of your API bundle which is hosted in some ec2 or somewhere else




  • Now attach integration to routes, choose GET and add your domain name here like https://test.xyz.com/api/hello (keep in mind you need to put api bundle in your test.xyz.com hosted website document root)




  • Now copy your Invoke URL and paste in URL and hit it , if everything is working fine it should give response to you something like
5) Code location on web server

  •  I can also show you where I have kept my code web server, but for you it depends on your tomcat configuration for me it is /var/lib/tomcat8/ (its my java code document root) 


Note: - This AWS Service API Gateway will only work when you have intermediate ssl certificate is installed in server. If you have not configured that don’t worry, I am here I have explained that in another page

https://vdkthakur.blogspot.com/2020/08/aws-apigatewayssl-intermediate-cert.html


    CheersπŸ‘
    Vik 
    Sr. Cloud-DevOps Engineer
         


 










Comments

Popular posts from this blog

MySQL DB access for user with roles base accesses   Hi Folks, πŸ™   Namaste and Welcome to my blog   πŸ™ Hope this finds you safe and healthy!   Today I am going to explain about if you are wanting to secure your Database server with proper user access-based policy. We can use MySQL role based policy,  A MySQL role is a named collection of privileges. I will show you how to do that by creating roles and users, then associating those users with newly created roles. Now each user will have different roles and access by that way a user like in read-only roles will not be able to delete anything as he is read only. In each role you can give access based on your project requirement. I will create all role and users form MySQL root user. Before that we need to understand privileges, type provided by MySQL Admin Privileges  – It allow user to managed MySQL server. They are Global level access can be hold by lower level u...
Kubernetes common issues with scenarios and solutions πŸ“˜ Scenario #1: Zombie Pods Causing NodeDrain to Hang Category: Cluster Management Environment: K8s v1.23, On-prem bare metal, Systemd cgroups  Scenario Summary: Node drain stuck indefinitely due to unresponsive terminating pod. What Happened: A pod with a custom finalizer never completed termination, blocking kubectl drain. Even after the pod was marked for deletion, the API server kept waiting because the finalizer wasn’t removed. Diagnosis Steps:  • Checked kubectl get pods --all-namespaces -o wide to find lingering pods.  • Found pod stuck in Terminating state for over 20 minutes.  • Used kubectl describe pod to identify the presence of a custom finalizer.  • Investigated controller logs managing the finalizer – the controller had crashed. Root Cause: Finalizer logic was never executed because its controller was down, leaving the pod undeletable. Fix/Workaround: kubectl patch pod -p '{"metadata":{"fina...