DEV Community

AutoConnectivity Check of EC2 to RDS Using Amazon EC2 Feature

“ I have checked the documents of AWS to resolve the issue of how to do autoconnectivity check of ec2 to rds using amazon ec2 feature. So I got Amazon Elastic Compute Cloud feature to directly connect to rds from ec2. Pricing of Amazon EC2 depends on instance type and storage of volume. Also pricing of rds depends on database type and storage.”

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. Access reliable, scalable infrastructure on demand. Scale capacity within minutes with SLA commitment of 99.99% availability. Provide secure compute for your applications. Security is built into the foundation of Amazon EC2 with the AWS Nitro System. Optimize performance and cost with flexible options like AWS Graviton based instance, Amazon EC2 spot instances and AWS Savings Plans.

In this post, you will get to know how to do autoconnectivity check of ec2 to rds using amazon ec2 feature. Here I have used an ec2 instance and rds database.

Architecture Overview

Image description
The architecture diagram shows the overall deployment architecture with data flow, amazon ec2, amazon rds.

Solution overview

The blog post consists of the following phases:

  1. Create of Mysql Database in Amazon RDS
  2. Create of EC2 Instance in Amazon Elastic Compute Cloud
  3. Enable and Verify Auto Connectivity from EC2 to RDS

Phase 1: Create of Mysql Database in Amazon RDS

  1. Open the Amazon RDS console, create a mysql database with default and required configurations. Also in the compute resource section of connectivity, set as don’t connect to an ec2 compute resource.

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Phase 2: Create of EC2 Instance in Amazon Elastic Compute Cloud

  1. Open the Amazon Elastic Compute Cloud console, launch an instance with default and required settings.

Image description

Image description

Image description

Image description

Image description

Image description

Phase 3: Enable and Verify Auto Connectivity from EC2 to RDS

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Image description

Clean-up

Delete EC2 Instance, RDS.

Pricing

I review the pricing and estimated cost of this example.

Cost of EC2 Instance = $0.09

Cost of RDS = $0.42

Total Cost = $(0.09 + 0.42) = $0.51

Summary

In this post, I showed “how to do autoconnectivity check of ec2 to rds using amazon ec2 feature”.

For more details on Amazon Elastic Compute Cloud, Checkout Get started Amazon Elastic Compute Cloud, open the Amazon Elastic Compute Cloud console. To learn more, read the Amazon Elastic Compute Cloud documentation.

Thanks for reading!

Connect with me: Linkedin
Image description

Top comments (0)