After preparing a deployable ecosystem, we have to host that ecosystem on a cloud provider to make application programming interface (API) endpoints visible to the public internet. We need to leverage cloud services such as Amazon Web Services (AWS) Elastic Compute Cloud (EC2) to deploy web services.
The journey doesn't end right after deployment. We have to track our API usage and performance for a better understanding of the clients. Who are the clients that are connecting to an API? How frequent are their requests? How many failed authorizations and so on are important factors for fine-tuning an API? For better security, an API server should not be directly exposed to the public internet.
In this chapter, we will explore AWS. However, sticking to a single cloud provider can be a problem for migration later. So, we will use a tool called Terraform to define and create our resources. Terraform is an Infrastructure as Code (IaC) tool that is cloud-agnostic. We provision an EC2 instance and an API Gateway in order to properly deploy our Representational State Transfer (REST) services.
In this chapter, we will cover the following topics:
- Basics for working with AWS
- IaC with Terraform
- Why is an API Gateway required?
- Introducing AWS API Gateway
- Other API Gateways