Skip to content

Commit

Permalink
[terraform] add backups to self-host aws rds
Browse files Browse the repository at this point in the history
Summary:
A previous commit for this had to be reverted. AWS randomly chooses maintainence window times and my selected maintainence window and backup window overlapping, causing the `terraform apply` to fail.

This diff ensures they are specified differently.

Test Plan: terraform apply. Ensured backup modifications were completed

Reviewers: bartek, varun

Reviewed By: bartek

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D13428
  • Loading branch information
wyilio committed Sep 24, 2024
1 parent 52da93d commit ae1d18e
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions services/terraform/self-host/aws_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,26 @@ resource "aws_security_group" "keyserver_mariadb_security_group" {

# MariaDB RDS Instance
resource "aws_db_instance" "mariadb" {
allocated_storage = 100
max_allocated_storage = 3000
storage_type = "gp3"
db_name = "mariadb"
identifier = "mariadb-instance"
engine = "mariadb"
engine_version = "10.11"
instance_class = var.db_instance_class
db_subnet_group_name = aws_db_subnet_group.public_db_subnet_group.name
vpc_security_group_ids = [aws_security_group.keyserver_mariadb_security_group.id]
username = local.mariadb_username
password = local.mariadb_password
parameter_group_name = aws_db_parameter_group.mariadb_parameter_group.name
storage_encrypted = true
publicly_accessible = true
port = local.mariadb_port
skip_final_snapshot = true
allocated_storage = 100
max_allocated_storage = 3000
storage_type = "gp3"
db_name = "mariadb"
identifier = "mariadb-instance"
engine = "mariadb"
engine_version = "10.11"
instance_class = var.db_instance_class
backup_retention_period = 7
backup_window = "08:00-09:00"
maintenance_window = "Mon:09:30-Mon:10:00"
db_subnet_group_name = aws_db_subnet_group.public_db_subnet_group.name
vpc_security_group_ids = [aws_security_group.keyserver_mariadb_security_group.id]
username = local.mariadb_username
password = local.mariadb_password
parameter_group_name = aws_db_parameter_group.mariadb_parameter_group.name
storage_encrypted = true
publicly_accessible = true
port = local.mariadb_port
skip_final_snapshot = true
}

# MariaDB Parameter Group
Expand Down

0 comments on commit ae1d18e

Please sign in to comment.