-
Notifications
You must be signed in to change notification settings - Fork 1
/
rds_admin.tf
50 lines (39 loc) · 1.32 KB
/
rds_admin.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
resource "aws_db_instance" "admin" {
identifier = "${var.prefix}-admin"
allocated_storage = var.admin_db_instance_allocated_storage
max_allocated_storage = var.admin_db_instance_max_allocated_storage
storage_type = "gp2"
engine = "postgres"
engine_version = var.admin_db_instance_version
instance_class = var.admin_db_instance_class
apply_immediately = true
backup_retention_period = 31
backup_window = "03:29-03:59"
db_name = "jupyterhub_admin"
username = "jupyterhub_admin_master"
password = random_string.aws_db_instance_admin_password.result
final_snapshot_identifier = "${var.prefix}-admin-final-snapshot"
copy_tags_to_snapshot = true
vpc_security_group_ids = ["${aws_security_group.admin_db.id}"]
db_subnet_group_name = aws_db_subnet_group.admin.name
performance_insights_enabled = true
storage_encrypted = true
lifecycle {
ignore_changes = [
"snapshot_identifier",
"final_snapshot_identifier",
"engine_version",
]
}
}
resource "aws_db_subnet_group" "admin" {
name = "${var.prefix}-admin"
subnet_ids = aws_subnet.private_with_egress.*.id
tags = {
Name = "${var.prefix}-admin"
}
}
resource "random_string" "aws_db_instance_admin_password" {
length = 128
special = false
}