From b2cc824e447e5cfabce5568beda861c9079dc2c5 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Tue, 19 May 2026 08:33:13 +0530 Subject: [PATCH 1/3] Modify EC2 instance configuration in main.tf Updated AMI ID and instance type for the app server. --- ec2/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ec2/main.tf b/ec2/main.tf index b70169b..ef60a16 100644 --- a/ec2/main.tf +++ b/ec2/main.tf @@ -15,8 +15,8 @@ provider "aws" { } resource "aws_instance" "app_server" { - ami = "ami-064ff912f78e3e561" - instance_type = "t2.micro" + ami = "ami-00a9f44477dd83e3d" + instance_type = "t3.micro" tags = { Name = "ExampleAppServerInstance" From b12c00a192eee018b6d016cac605d22d64ef9c85 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Tue, 19 May 2026 09:38:26 +0530 Subject: [PATCH 2/3] Add Terraform configuration for MySQL RDS instance This Terraform configuration sets up an RDS instance with a security group allowing MySQL access. --- RDS | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 RDS diff --git a/RDS b/RDS new file mode 100644 index 0000000..6c333a6 --- /dev/null +++ b/RDS @@ -0,0 +1,51 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + } +} + +provider "aws" { + region = var.aws_region +} + +resource "aws_security_group" "rds_sg" { + name = "rds-security-group" + + ingress { + description = "MySQL Access" + from_port = 3306 + to_port = 3306 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_db_instance" "mysql_rds" { + identifier = "bharath-mysql-rds" + allocated_storage = 20 + storage_type = "gp2" + engine = "mysql" + engine_version = "8.0" + instance_class = "db.t3.micro" + db_name = "mydatabase" + username = var.db_username + password = var.db_password + parameter_group_name = "default.mysql8.0" + publicly_accessible = true + skip_final_snapshot = true + vpc_security_group_ids = [aws_security_group.rds_sg.id] + + tags = { + Name = "Terraform-RDS" + } +} From ccd4a92e683030563d83035d8c8ec783e2cbcdd3 Mon Sep 17 00:00:00 2001 From: Aditya Yadav Date: Tue, 19 May 2026 09:51:09 +0530 Subject: [PATCH 3/3] Fix missing newline at end of main.tf