From 3e03028aa7f01b8575986f3f1d2a339cde9d24cc Mon Sep 17 00:00:00 2001 From: magreenbaum Date: Fri, 16 May 2025 21:41:40 -0400 Subject: [PATCH] recovery period in days --- README.md | 5 +++-- examples/autoscaling/README.md | 2 +- examples/autoscaling/versions.tf | 2 +- examples/basic/README.md | 2 +- examples/basic/versions.tf | 2 +- examples/global-tables/README.md | 6 +++--- examples/global-tables/versions.tf | 2 +- examples/s3-import/README.md | 2 +- examples/s3-import/versions.tf | 2 +- main.tf | 9 ++++++--- variables.tf | 6 ++++++ versions.tf | 2 +- wrappers/main.tf | 1 + wrappers/versions.tf | 2 +- 14 files changed, 28 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index a797fd3..14bcb71 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,13 @@ Users of Terragrunt can achieve similar results by using modules provided in the | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.72.1 | +| [aws](#requirement\_aws) | >= 5.98 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.72.1 | +| [aws](#provider\_aws) | >= 5.98 | ## Modules @@ -118,6 +118,7 @@ No modules. | [name](#input\_name) | Name of the DynamoDB table | `string` | `null` | no | | [on\_demand\_throughput](#input\_on\_demand\_throughput) | Sets the maximum number of read and write units for the specified on-demand table | `any` | `{}` | no | | [point\_in\_time\_recovery\_enabled](#input\_point\_in\_time\_recovery\_enabled) | Whether to enable point-in-time recovery | `bool` | `false` | no | +| [point\_in\_time\_recovery\_period\_in\_days](#input\_point\_in\_time\_recovery\_period\_in\_days) | Number of preceding days for which continuous backups are taken and maintained. Default 35 | `number` | `null` | no | | [range\_key](#input\_range\_key) | The attribute to use as the range (sort) key. Must also be defined as an attribute | `string` | `null` | no | | [read\_capacity](#input\_read\_capacity) | The number of read units for this table. If the billing\_mode is PROVISIONED, this field should be greater than 0 | `number` | `null` | no | | [replica\_regions](#input\_replica\_regions) | Region names for creating replicas for a global DynamoDB table. | `any` | `[]` | no | diff --git a/examples/autoscaling/README.md b/examples/autoscaling/README.md index 61dc031..2a7d2a0 100644 --- a/examples/autoscaling/README.md +++ b/examples/autoscaling/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.72.1 | +| [aws](#requirement\_aws) | >= 5.98 | | [random](#requirement\_random) | >= 2.0 | ## Providers diff --git a/examples/autoscaling/versions.tf b/examples/autoscaling/versions.tf index 8672707..6d2b299 100644 --- a/examples/autoscaling/versions.tf +++ b/examples/autoscaling/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } random = { source = "hashicorp/random" diff --git a/examples/basic/README.md b/examples/basic/README.md index bc5e27c..21f55c1 100644 --- a/examples/basic/README.md +++ b/examples/basic/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.72.1 | +| [aws](#requirement\_aws) | >= 5.98 | | [random](#requirement\_random) | >= 2.0 | ## Providers diff --git a/examples/basic/versions.tf b/examples/basic/versions.tf index 8672707..6d2b299 100644 --- a/examples/basic/versions.tf +++ b/examples/basic/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } random = { source = "hashicorp/random" diff --git a/examples/global-tables/README.md b/examples/global-tables/README.md index 7177002..d346a14 100644 --- a/examples/global-tables/README.md +++ b/examples/global-tables/README.md @@ -20,15 +20,15 @@ Note that this example may create resources which can cost money (AWS Elastic IP | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.72.1 | +| [aws](#requirement\_aws) | >= 5.98 | | [random](#requirement\_random) | >= 2.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.72.1 | -| [aws.euwest2](#provider\_aws.euwest2) | >= 5.72.1 | +| [aws](#provider\_aws) | >= 5.98 | +| [aws.euwest2](#provider\_aws.euwest2) | >= 5.98 | | [random](#provider\_random) | >= 2.0 | ## Modules diff --git a/examples/global-tables/versions.tf b/examples/global-tables/versions.tf index 8672707..6d2b299 100644 --- a/examples/global-tables/versions.tf +++ b/examples/global-tables/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } random = { source = "hashicorp/random" diff --git a/examples/s3-import/README.md b/examples/s3-import/README.md index 496cae9..63bf58b 100644 --- a/examples/s3-import/README.md +++ b/examples/s3-import/README.md @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.72.1 | +| [aws](#requirement\_aws) | >= 5.98 | | [random](#requirement\_random) | >= 2.0 | ## Providers diff --git a/examples/s3-import/versions.tf b/examples/s3-import/versions.tf index 8672707..6d2b299 100644 --- a/examples/s3-import/versions.tf +++ b/examples/s3-import/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } random = { source = "hashicorp/random" diff --git a/main.tf b/main.tf index e0d9167..91a2589 100644 --- a/main.tf +++ b/main.tf @@ -26,7 +26,8 @@ resource "aws_dynamodb_table" "this" { } point_in_time_recovery { - enabled = var.point_in_time_recovery_enabled + enabled = var.point_in_time_recovery_enabled + recovery_period_in_days = var.point_in_time_recovery_period_in_days } dynamic "attribute" { @@ -166,7 +167,8 @@ resource "aws_dynamodb_table" "autoscaled" { } point_in_time_recovery { - enabled = var.point_in_time_recovery_enabled + enabled = var.point_in_time_recovery_enabled + recovery_period_in_days = var.point_in_time_recovery_period_in_days } dynamic "attribute" { @@ -310,7 +312,8 @@ resource "aws_dynamodb_table" "autoscaled_gsi_ignore" { } point_in_time_recovery { - enabled = var.point_in_time_recovery_enabled + enabled = var.point_in_time_recovery_enabled + recovery_period_in_days = var.point_in_time_recovery_period_in_days } dynamic "attribute" { diff --git a/variables.tf b/variables.tf index 2261d86..e5d42f4 100644 --- a/variables.tf +++ b/variables.tf @@ -52,6 +52,12 @@ variable "point_in_time_recovery_enabled" { default = false } +variable "point_in_time_recovery_period_in_days" { + description = "Number of preceding days for which continuous backups are taken and maintained. Default 35" + type = number + default = null +} + variable "ttl_enabled" { description = "Indicates whether ttl is enabled" type = bool diff --git a/versions.tf b/versions.tf index 2f5fe63..e138983 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } } } diff --git a/wrappers/main.tf b/wrappers/main.tf index 9a8c4a5..c24c994 100644 --- a/wrappers/main.tf +++ b/wrappers/main.tf @@ -24,6 +24,7 @@ module "wrapper" { name = try(each.value.name, var.defaults.name, null) on_demand_throughput = try(each.value.on_demand_throughput, var.defaults.on_demand_throughput, {}) point_in_time_recovery_enabled = try(each.value.point_in_time_recovery_enabled, var.defaults.point_in_time_recovery_enabled, false) + point_in_time_recovery_period_in_days = try(each.value.point_in_time_recovery_period_in_days, var.defaults.point_in_time_recovery_period_in_days, null) range_key = try(each.value.range_key, var.defaults.range_key, null) read_capacity = try(each.value.read_capacity, var.defaults.read_capacity, null) replica_regions = try(each.value.replica_regions, var.defaults.replica_regions, []) diff --git a/wrappers/versions.tf b/wrappers/versions.tf index 2f5fe63..e138983 100644 --- a/wrappers/versions.tf +++ b/wrappers/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.72.1" + version = ">= 5.98" } } }