Skip to content

Commit e6a9d7a

Browse files
author
marycrawford
committed
update rds instance attributes
1 parent 0a6203f commit e6a9d7a

File tree

1 file changed

+38
-6
lines changed
  • terraform/aws/implementation/modules/rds

1 file changed

+38
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,46 @@
11
resource "aws_db_instance" "query-templates" {
2-
identifier = "query-templates"
2+
identifier = var.db_identifier
33
instance_class = "db.t3.micro"
44
allocated_storage = 5
55
engine = "postgres"
66
engine_version = "16.3"
77
username = var.db_username
88
password = var.db_password
9-
#db_subnet_group_name = aws_db_subnet_group.education.name
10-
#vpc_security_group_ids = var.private_subnet_ids
11-
#parameter_group_name = aws_db_parameter_group.education.name
12-
publicly_accessible = false
13-
#skip_final_snapshot = true
9+
# db_subnet_group_name = aws_db_subnet_group.default.name
10+
# vpc_security_group_ids = aws_security_group.db_sg.id
11+
parameter_group_name = aws_db_parameter_group.this.name
12+
publicly_accessible = false
13+
skip_final_snapshot = false
14+
backup_retention_period = 30
15+
final_snapshot_identifier = "${var.db_identifier}-backup"
1416
}
17+
18+
resource "aws_db_parameter_group" "this" {
19+
name = "${var.db_identifier}-pg"
20+
family = "postgres16"
21+
22+
parameter {
23+
name = "log_connections"
24+
value = "1"
25+
}
26+
27+
lifecycle {
28+
create_before_destroy = true
29+
}
30+
}
31+
32+
# resource "aws_db_subnet_group" "default" {
33+
# name = "main"
34+
# subnet_ids = var.private_subnet_ids
35+
# tags = {
36+
# Name = "${var.db_identifier}-private-subnet-group"
37+
# }
38+
# }
39+
40+
# Create a security group
41+
# resource "aws_security_group" "db_sg" {
42+
# vpc_id = var.vpc_id
43+
# tags = {
44+
# Name = "${var.db_identifier}-security-group"
45+
# }
46+
# }

0 commit comments

Comments
 (0)