Migrating Node.js and PostgreSQL to AWS Platform | AWS Engineer Responsibilities

Migrating On-Premises Main Page to AWS: Node.js and PostgreSQL

Prev Question Next Question

Question

You are hired as an AWS engineer.

Your major responsibility is to migrate existing services to the AWS platform.

The company's on-premises main page is made of Node.js and PostgreSQL database.

You just migrated the frontend and backend to an EC2 instance.

Also, you created a PostgreSQL instance in RDS.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer A, D.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html#CHAP_Troubleshooting.SQLServer.Connect

Option A is CORRECT: Because if the used endpoint or port is incorrect, the error would be “Connection timed out”.

Option B is incorrect: Because the AWS SDK version does not cause the issue to communicate with the RDS instance.

Option C is incorrect: Because the low configured capacity does not lead to a “Connection timed out” issue.

Option D is CORRECT: Because the most common problem when attempting to connect to a PostgreSQL DB instance is that the security group assigned to the DB instance has incorrect access rules.

As an AWS engineer responsible for migrating existing services to the AWS platform, you have already migrated the on-premises main page to an EC2 instance and created a PostgreSQL instance in RDS. However, after the migration, you are experiencing issues with connecting to the RDS instance. In such a scenario, there are several things you can check to diagnose the issue:

A. Check that if the hostname is the DB instance endpoint and the port number is correct: The first thing to check is the endpoint and port number used to connect to the RDS instance. Ensure that the hostname matches the DB instance endpoint and that the port number is correct. By default, PostgreSQL uses port 5432, so ensure that you are connecting to the correct port.

B. Check if the AWS SDK version is correct as there are issues for certain versions to communicate with RDS instances: The AWS SDK is a collection of tools and libraries that enable developers to interact with various AWS services. Ensure that the AWS SDK version being used is compatible with RDS. Some older versions of the AWS SDK may have issues communicating with RDS instances, so make sure you are using a compatible version.

C. Check if the RDS instance has configured enough read and write capacity. If not, the “Connection timed out” issue may appear: RDS instances come with a default set of resources, including compute, storage, and network resources. Ensure that the RDS instance has enough read and write capacity to handle the traffic from the EC2 instance. If the RDS instance is running out of resources, you may experience "Connection timed out" issues.

D. Check that the security group assigned to the DB instance has the necessary rules to allow access through the EC2 instance: Security groups are used to control inbound and outbound traffic to AWS resources. Ensure that the security group assigned to the RDS instance has the necessary rules to allow access through the EC2 instance. By default, RDS instances do not allow inbound traffic, so you must create a security group rule that allows inbound traffic from the EC2 instance.

In summary, when experiencing issues with connecting to an RDS instance after migrating services to the AWS platform, ensure that the hostname and port number are correct, the AWS SDK version is compatible, the RDS instance has enough read and write capacity, and the security group assigned to the RDS instance has the necessary rules to allow access through the EC2 instance.