This is #90DaysofDevops challenge under the guidance of Shubham Londhe sir.
Introduction
Welcome to Day 44 of our AWS journey! Today, we delve into the realm of Amazon Relational Database Service (Amazon RDS), a powerhouse of managed services simplifying database management in the cloud.
Amazon Relational Database Service (RDS):
Amazon RDS is a cloud-based service provided by Amazon Web Services (AWS) that simplifies the setup, management, and scaling of relational databases. It automates time-consuming administrative tasks like hardware provisioning, database setup, patching, and backups, allowing developers to focus more on application development rather than database management.
Key Features of Amazon RDS:
Managed Service: Amazon RDS is a fully managed service, which means AWS takes care of routine database tasks such as software patching, backups, and monitoring. This reduces the administrative overhead for users.
Multiple Database Engines: RDS supports various popular relational database engines like MySQL, PostgreSQL, MariaDB, Oracle, and Microsoft SQL Server, providing flexibility for different application requirements.
Automatic Backups and Point-in-Time Recovery: RDS automatically backs up your database and allows you to restore to any specific point in time within your retention period, providing data durability and recovery options.
Scalability: RDS allows you to easily scale your database instance vertically (by increasing CPU, memory, or storage) or horizontally (by adding read replicas), ensuring that your database can handle varying workloads and demands.
Security: RDS offers built-in security features such as encryption at rest and in transit, network isolation using Virtual Private Cloud (VPC), and IAM integration for authentication and authorization, helping to protect sensitive data and meet compliance requirements.
Monitoring and Metrics: RDS provides monitoring tools and metrics through Amazon CloudWatch, allowing you to monitor database performance, set alarms, and troubleshoot issues proactively.
Task-01: Setting Up MySQL on Amazon RDS
Create a Free Tier RDS Instance of MySQL:
Log in to your AWS Management Console.
Navigate to the Amazon RDS service.
Click on "Create database" to start the creation wizard.
Choose "MySQL" as the database engine.
Select the appropriate version and edition.
Specify your DB instance class and storage allocation.
Configure your database settings, including DB instance identifier, master username, and password.
Review your configuration and click "Create database" to initiate the deployment process.
Wait for the RDS instance to be provisioned, which may take a few minutes.
Create an EC2 Instance:
From the AWS Management Console, go to the EC2 dashboard.
Click on "Launch Instance" to start the instance creation process.
Choose an Amazon Machine Image (AMI) based on your requirements.
Select the instance type and configure instance details like network settings, storage, and tags.
Configure security groups to allow inbound traffic to your EC2 instance, including MySQL traffic.
Review your instance configuration and launch the instance.
Optionally, create or select an existing key pair for SSH access.
Create an IAM Role with RDS Access:
Go to the IAM dashboard in the AWS Management Console.
Click on "Roles" and then "Create role".
Choose the service that will use this role (in our case, EC2).
Attach policies that grant the necessary permissions to interact with RDS, such as AmazonRDSFullAccess or custom policies.
Review the role configuration and give it a meaningful name.
Create the role.
Assign the Role to EC2:
Locate the EC2 instance you created earlier in the EC2 dashboard.
Select the instance and choose "Actions" > "Instance Settings" > "Attach/Replace IAM Role".
Select the IAM role you created in the previous step and attach it to the instance.
Connect EC2 Instance with RDS:
SSH into your EC2 instance using the key pair you specified during instance creation.
Install MySQL client software if not already installed.
Use the MySQL client to connect to the RDS instance using the endpoint, master username, and password specified during RDS instance creation.
Once connected, you can execute SQL commands and manage your MySQL database hosted on Amazon RDS.
By following these steps, you'll successfully set up MySQL on Amazon RDS and establish connectivity between your EC2 instance and RDS database.