Skip to content

Instantly share code, notes, and snippets.

@khushi20218
Created September 6, 2020 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khushi20218/15e1c1f65823dac3d62635b72392a166 to your computer and use it in GitHub Desktop.
Save khushi20218/15e1c1f65823dac3d62635b72392a166 to your computer and use it in GitHub Desktop.
# subnet group for DB
resource "aws_db_subnet_group" "sub_ids" {
name = "main"
subnet_ids = data.aws_subnet_ids.vpc_sub.ids
tags = {
Name = "DB subnet group"
}
}
# DB Instances
resource "aws_db_instance" "rds_wp" {
engine = "mysql"
engine_version = "5.7"
identifier = "wordpress-db"
username = "admin"
password = "admin1234%^"
instance_class = "db.t2.micro"
storage_type = "gp2"
allocated_storage = 20
db_subnet_group_name = aws_db_subnet_group.sub_ids.id
vpc_security_group_ids = [aws_security_group.allow_data_in_db.id]
publicly_accessible = true
name = "wpdb"
parameter_group_name = "default.mysql5.7"
skip_final_snapshot = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment