Skip to content

Commit

Permalink
Changing the name of the final snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCinquini committed Jan 27, 2025
1 parent 6ecab20 commit 8834f77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions terraform-unity/modules/terraform-unity-sps-database/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ data "aws_db_snapshot" "latest_snapshot" {
db_instance_identifier = format(local.resource_name_prefix, "db")
most_recent = true

# tags = merge(local.common_tags, {
# Name = format(local.resource_name_prefix, "db")
# Component = "processing"
# Stack = "processing"
# })

}

data "external" "rds_final_snapshot_exists" {
Expand Down
13 changes: 8 additions & 5 deletions terraform-unity/modules/terraform-unity-sps-database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ resource "aws_db_instance" "sps_db" {
parameter_group_name = "default.postgres16"

backup_retention_period = 7
backup_window = "01:00-02:00"
storage_encrypted = true
copy_tags_to_snapshot = true
# 07:00-08:00 GMT = 01:00-02:00 PST
backup_window = "07:00-08:00"
storage_encrypted = true
copy_tags_to_snapshot = true

skip_final_snapshot = false
final_snapshot_identifier = "${terraform.workspace}-${formatdate("YYYYMMDDhhmmss", timestamp())}"
skip_final_snapshot = false
# rds:unity-luca-1-dev-sps-db-2025-01-26-12-14
# unity-luca-1-dev-sps-20250122213608
final_snapshot_identifier = "${terraform.workspace}-db-${formatdate("YYYY-MM-DD-hh-mm", timestamp())}"
snapshot_identifier = try(data.aws_db_snapshot.latest_snapshot[0].id, null)
publicly_accessible = false
db_subnet_group_name = aws_db_subnet_group.db.name
Expand Down

0 comments on commit 8834f77

Please sign in to comment.