Skip to content

Commit

Permalink
Merge pull request #16 from DNXLabs/feature/final_snapshot
Browse files Browse the repository at this point in the history
Remove timestamp to avoid drifts
  • Loading branch information
brunodasilvalenga authored Mar 17, 2022
2 parents ee0f365 + fb2ade2 commit 7f4c288
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions _variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
locals {
timestamp = "${timestamp()}"
timestamp_sanitized = "${replace("${local.timestamp}", "/[-| |T|Z|:]/", "")}"
}

variable "name" {
type = string
description = "Name of this RDS Database"
Expand Down
2 changes: 1 addition & 1 deletion rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_db_instance" "rds_db" {
monitoring_role_arn = var.monitoring_interval > 0 ? aws_iam_role.rds_monitoring[count.index].arn : ""
maintenance_window = var.maintenance_window
backup_window = var.backup_window
final_snapshot_identifier = var.final_snapshot_identifier == "" ? "${var.environment_name}-${var.name}-${local.timestamp_sanitized}" : var.final_snapshot_identifier
final_snapshot_identifier = var.final_snapshot_identifier == "" ? "${var.environment_name}-${var.name}-final-snapshot" : var.final_snapshot_identifier

tags = {
Backup = var.backup
Expand Down

0 comments on commit 7f4c288

Please sign in to comment.