We then started setting up our VPC, Subnets, Routing Table and we also set up an Internet Gateway and we have the following architecture in place (you can check my earlier post on AWS Internet Gateway and VPC Routing for details): You can think of this as a service that provides servers where your applications will be running. Let me know if you have any comments or questions.In my earlier post on AWS Basics, we learned that the core of AWS is EC2. Later, we will be running our application on a different EC2 instance and then will check if our application can access the database while running on different EC2 or not, and what can be needed to make that happen. You can download the application code from this Git repo. We also test the database connectivity with a locally running Nodejs application. We then installed PostgreSQL on an Ubuntu EC2 instance running in a private subnet with some test data. We talked about some background information and discussed a basic VPC setup with two subnets and two EC2 instances. This was the first post in series about application deployments on AWS. Node application is simply using pg library for the database connection and query and returning the data.įollowing diagram shows the application and database running on the same EC2 instance: Now, I make another SSH connection to ubuntu EC2 (via jump host) and make a curl request on port 3000 as follows:Īs you can see the Node application is able to read the data from the Postgres database. Now, we want to install PostgreSQL on the Ubuntu EC2 instance running in the private subnet. You can learn about all the above parts needed to set up this infrastructure from the posts links mentioned above. ![]() lambda-sg Security-Group attached (we will use it later)ĪWS Infrastructure setup up to this will be the starting point for this series.fm-private-ubuntu-sg Security-Group attached.Amazon Linux Image setup as a NAT Server.Next, I launched two EC2 instances (one in each subnet) as shown in the diagram below: I also configured inbound/outbound rules as shown in the diagram above. It has two subnets, an internet gateway, two custom route-tables, and few security groups: I have already set up a VPC with public and private subnets, created an internet gateway, security groups, and route tables, and configured the traffic flow. If you are new to AWS or want to refresh some of the background knowledge which I will be using in this series, you can read the above-mentioned posts as needed. A Beginner’s Guide to AWS Security Groups.An Introduction to AWS EC2 (Elastic Compute Cloud).An Introduction to AWS Internet Gateway and VPC Routing.How to Create an AWS Relational Database Service (RDS).In those posts, I covered many different areas of AWS and those shall provide enough background information to help us deploy various application workloads in AWS. ![]() I’ve recently written some posts on DZone about different Amazon Web Services. ![]() Then we will try to connect to it via a NodeJS application that will be running locally on the same machine. In this post, we will cover how to set up a PostgreSQL database running on AWS EC2 in a private subnet of a VPC. This series will be arranged in different parts to discuss different services, topics, and/or technologies needed for application deployment and execution.ĭatabases are one of the basic building blocks of many different types of applications. We will be covering different moving parts in AWS as needed to run typical applications. In this series about deploying applications in AWS, I will discuss different methods and steps required to run different applications in AWS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |