Skip to content

Commit

Permalink
feat: add resource rds instance
Browse files Browse the repository at this point in the history
  • Loading branch information
dusdjhyeon committed Dec 7, 2023
1 parent 9dc1eaa commit ec15fc3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions module-rds/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
provider "aws" {
region = var.aws_region
}

resource "aws_db_subnet_group" "db-subnet-group" {
name = "db-subnet-group"
subnet_ids = var.db_subnet_ids

tags = {
Name = "khu-db-subnet-group"
}
}

resource "aws_db_instance" "khu-rds" {
allocated_storage = 20
storage_type = "gp2"
engine = "mysql"
engine_version = "8.0"
instance_class = "db.t2.micro"
db_name = var.db_name
username = var.db_username
password = var.db_password
parameter_group_name = "default.mysql8.0"
db_subnet_group_name = aws_db_subnet_group.db-subnet-group.name
multi_az = true
}

0 comments on commit ec15fc3

Please sign in to comment.