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

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...
APIGateway SSL intermediate cert issue,while connecting to web server:- Hi Folks,  🙏 Namaste and Welcome to my blog 🙏 Hope this finds you safe and healthy!  Today I will explain about if you are getting issue to connect your newly create AWS API gateway to your running web server (My web server is tomcat8 running on ec2). First you need to check what is error for you in my case i am getting some missing intermediate ssl cert issue.  So for that you may ask to provide a complete ssl cert chain from your web server admin who have previously configure ssl cert for your web server , or if you are owner of that server yourself then no worry i will tell you how we can download intermediate cert from website and how can we configure it'. Stay here 😉 1) Download intermediate Cert 2) Move the downloaded cert to web server 3) Configure that new intermediate cert in your web server 4) Restart tomcat 5) Verify Intermediate Cert Installed properly or not with Online SSL checke...