-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrds.tf
23 lines (20 loc) · 802 Bytes
/
rds.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
resource "aws_db_subnet_group" "default" {
name = "main"
subnet_ids = [aws_subnet.this["pvt_a"].id, aws_subnet.this["pvt_b"].id]
tags = merge(local.common_tags, { Name = "DB-subnet-group-terraform-application-auto-scaling" })
}
resource "aws_db_instance" "web" {
allocated_storage = 10
storage_type = "gp2"
engine = "mysql"
engine_version = "5.7"
instance_class = "db.t2.micro"
db_name = "dbTerraformApplicationAutoScaling"
username = "foo"
password = "foobarbaz"
parameter_group_name = "default.mysql5.7"
availability_zone = "${var.aws_region}a"
skip_final_snapshot = true
db_subnet_group_name = aws_db_subnet_group.default.id
vpc_security_group_ids = [aws_security_group.db.id]
}