In Chapter 2, we used Amazon Web Services (AWS) to set up a PostgreSQL RDS. In this chapter, we will use an AWS EC2 instance to create an API from Node.js to PostgreSQL.
An EC2 instance is a virtual server in Elastic Compute Cloud (or EC2) for executing our applications on the cloud infrastructure. Hence EC2 is a service evolving cloud computing platform and there are a variety of types of EC2 instances with different configurations of CPU, memory, storage, and networking resources to suit user needs. Each type is also available in two different sizes to address workload requirements.
In order to launch our EC2 instance for Node.js, we need to select an Amazon Machine Image (AMI), which is a special type of virtual appliance to deploy for services delivered to our EC2 instance. For our Node.js project in this chapter, we will use a good AWS AMI: ami-7d579d00, as seen in Figure 3.1.
We decide to use a CentOS image because CentOS is a very stable Linux version...