diff --git a/src/cluster-regional.tf b/src/cluster-regional.tf index a914f1e..f40c025 100644 --- a/src/cluster-regional.tf +++ b/src/cluster-regional.tf @@ -49,6 +49,7 @@ module "aurora_postgres_cluster" { autoscaling_max_capacity = var.autoscaling_max_capacity scaling_configuration = var.scaling_configuration serverlessv2_scaling_configuration = var.serverlessv2_scaling_configuration + restore_to_point_in_time = var.restore_to_point_in_time skip_final_snapshot = var.skip_final_snapshot deletion_protection = var.deletion_protection snapshot_identifier = var.snapshot_identifier diff --git a/src/variables.tf b/src/variables.tf index 6992e19..fdc9adb 100644 --- a/src/variables.tf +++ b/src/variables.tf @@ -335,6 +335,28 @@ variable "serverlessv2_scaling_configuration" { description = "Nested attribute with scaling properties for ServerlessV2. Only valid when `engine_mode` is set to `provisioned.` This is required for Serverless v2" } +variable "restore_to_point_in_time" { + type = list(object({ + source_cluster_identifier = string + restore_type = optional(string, "copy-on-write") + use_latest_restorable_time = optional(bool, true) + restore_to_time = optional(string, null) + })) + default = [] + description = <<-EOT + List of point-in-time recovery options. Valid parameters are: + + `source_cluster_identifier` + Identifier of the source database cluster from which to restore. + `restore_type`: + Type of restore to be performed. Valid options are "full-copy" and "copy-on-write". + `use_latest_restorable_time`: + Set to true to restore the database cluster to the latest restorable backup time. Conflicts with `restore_to_time`. + `restore_to_time`: + Date and time in UTC format to restore the database cluster to. Conflicts with `use_latest_restorable_time`. +EOT +} + variable "intra_security_group_traffic_enabled" { type = bool default = false