Skip to content

Commit

Permalink
Create main.tf
Browse files Browse the repository at this point in the history
  • Loading branch information
anujdevopslearn authored Apr 25, 2024
1 parent 6fd43a1 commit 0571509
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions rds_terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// rds.tf

resource "aws_security_group" "example" {
name_prefix = "example-"
ingress {
from_port = 0
to_port = 3306
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}

resource "aws_db_instance" "example" {
engine = "mysql"
db_name = "example"
identifier = "example"
instance_class = "db.t2.micro"
allocated_storage = 20
publicly_accessible = true
username = var.db-username
password = var.db-password
vpc_security_group_ids = [aws_security_group.example.id]
skip_final_snapshot = true

tags = {
Name = "example-db"
}
}

0 comments on commit 0571509

Please sign in to comment.