-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
44 lines (35 loc) · 1.05 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
data "terraform_remote_state" "network" {
backend = "remote"
config = {
organization = "kloehfelm-demo"
workspaces = {
name = "tf-aws-network"
}
}
}
module "db" {
source = "terraform-aws-modules/rds/aws"
create_db_instance = var.enable_database
create_db_subnet_group = var.enable_database
create_db_option_group = var.enable_database
create_db_parameter_group = var.enable_database
identifier = "${var.label}-rds"
engine = "mysql"
major_engine_version = "5.7"
family = "mysql5.7"
engine_version = "5.7.40"
instance_class = "db.m5.large"
allocated_storage = 5
db_name = "${var.label}-db"
username = "dbadmin"
port = "3306"
multi_az = true
skip_final_snapshot = var.skip_final_snapshot
subnet_ids = data.terraform_remote_state.network.outputs.database_subnets
tags = {
"env:platform" = "aws"
"env:provisioner" = "Terraform"
"tfc:organization" = "kloehfelm-demo"
"tfc:workspace" = "${terraform.workspace}"
}
}