Skip to content

Commit 929f9ee

Browse files
authored
feat: Add support for restore_to_point_in_time (#194)
1 parent 517695b commit 929f9ee

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ No modules.
174174
| <a name="input_replica_scale_min"></a> [replica\_scale\_min](#input\_replica\_scale\_min) | Minimum number of read replicas permitted when autoscaling is enabled | `number` | `2` | no |
175175
| <a name="input_replica_scale_out_cooldown"></a> [replica\_scale\_out\_cooldown](#input\_replica\_scale\_out\_cooldown) | Cooldown in seconds before allowing further scaling operations after a scale out | `number` | `300` | no |
176176
| <a name="input_replication_source_identifier"></a> [replication\_source\_identifier](#input\_replication\_source\_identifier) | ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica | `string` | `""` | no |
177+
| <a name="input_restore_to_point_in_time"></a> [restore\_to\_point\_in\_time](#input\_restore\_to\_point\_in\_time) | Map of nested attributes for cloning Aurora cluster. | `map(string)` | `{}` | no |
177178
| <a name="input_s3_import"></a> [s3\_import](#input\_s3\_import) | Configuration map used to restore from a Percona Xtrabackup in S3 (only MySQL is supported) | `map(string)` | `null` | no |
178179
| <a name="input_scaling_configuration"></a> [scaling\_configuration](#input\_scaling\_configuration) | Map of nested attributes with scaling properties. Only valid when engine\_mode is set to `serverless` | `map(string)` | `{}` | no |
179180
| <a name="input_security_group_description"></a> [security\_group\_description](#input\_security\_group\_description) | The description of the security group. If value is set to empty string it will contain cluster name in the description | `string` | `"Managed by Terraform"` | no |

main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ resource "aws_rds_cluster" "this" {
106106
}
107107
}
108108

109+
dynamic "restore_to_point_in_time" {
110+
for_each = length(keys(var.restore_to_point_in_time)) == 0 ? [] : [var.restore_to_point_in_time]
111+
112+
content {
113+
source_cluster_identifier = restore_to_point_in_time.value.source_cluster_identifier
114+
restore_type = lookup(restore_to_point_in_time.value, "restore_type", null)
115+
use_latest_restorable_time = lookup(restore_to_point_in_time.value, "use_latest_restorable_time", null)
116+
restore_to_time = lookup(restore_to_point_in_time.value, "restore_to_time", null)
117+
}
118+
}
119+
109120
tags = merge(var.tags, var.cluster_tags)
110121
}
111122

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ variable "scaling_configuration" {
178178
default = {}
179179
}
180180

181+
variable "restore_to_point_in_time" {
182+
description = "Map of nested attributes for cloning Aurora cluster."
183+
type = map(string)
184+
default = {}
185+
}
186+
181187
variable "snapshot_identifier" {
182188
description = "DB snapshot to create this database from"
183189
type = string

0 commit comments

Comments
 (0)