-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrds.tf
executable file
·86 lines (63 loc) · 1.8 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# RDS subnet group
resource "aws_db_subnet_group" "rancher" {
name = "${var.env_name}-rds-sn"
subnet_ids = ["${var.priv_sub_a}", "${var.priv_sub_b}"]
description = "${var.env_name}-rds-sn"
tags {
Name = "${var.env_name}-rds-sn"
}
}
# RDS instance
resource "aws_db_instance" "rancher" {
engine = "mysql"
storage_type = "gp2"
instance_class = "${var.db_class}"
name = "${var.db_name}"
username = "${var.db_username}"
password = "${var.db_password}"
allocated_storage = "${var.db_storage}"
backup_retention_period = "${var.db_backup_retention}"
multi_az = "${var.db_multi_az}"
identifier = "${var.env_name}-rds"
db_subnet_group_name = "${aws_db_subnet_group.rancher.name}"
vpc_security_group_ids = ["${aws_security_group.rds.id}"]
final_snapshot_identifier = "${var.env_name}-snapshot"
skip_final_snapshot = "${var.db_final_snapshot}"
#parameter_group_name = "rancher-pg"
}
#resource "aws_db_parameter_group" "rancher" {
# name = "rancher-pg"
# family = "mysql5.6"
# parameter {
# name = "character_set_client"
# value = "utf8"
# }
# parameter {
# name = "character_set_connection"
# value = "utf8"
# }
# parameter {
# name = "character_set_database"
# value = "utf8"
# }
# parameter {
# name = "character_set_filesystem"
# value = "utf8"
# }
# parameter {
# name = "character_set_results"
# value = "utf8"
# }
# parameter {
# name = "character_set_server"
# value = "utf8"
# }
# parameter {
# name = "collation_connection"
# value = "utf8_general_ci"
# }
# parameter {
# name = "collation_server"
# value = "utf8_general_ci"
# }
#}