Created
September 6, 2020 13:49
-
-
Save khushi20218/15e1c1f65823dac3d62635b72392a166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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