Skip to content

feat: PITR Recovery Period in Days #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ Users of Terragrunt can achieve similar results by using modules provided in the
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.72.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.72.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.98 |

## Modules

Expand Down Expand Up @@ -118,6 +118,7 @@ No modules.
| <a name="input_name"></a> [name](#input\_name) | Name of the DynamoDB table | `string` | `null` | no |
| <a name="input_on_demand_throughput"></a> [on\_demand\_throughput](#input\_on\_demand\_throughput) | Sets the maximum number of read and write units for the specified on-demand table | `any` | `{}` | no |
| <a name="input_point_in_time_recovery_enabled"></a> [point\_in\_time\_recovery\_enabled](#input\_point\_in\_time\_recovery\_enabled) | Whether to enable point-in-time recovery | `bool` | `false` | no |
| <a name="input_point_in_time_recovery_period_in_days"></a> [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 |
| <a name="input_range_key"></a> [range\_key](#input\_range\_key) | The attribute to use as the range (sort) key. Must also be defined as an attribute | `string` | `null` | no |
| <a name="input_read_capacity"></a> [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 |
| <a name="input_replica_regions"></a> [replica\_regions](#input\_replica\_regions) | Region names for creating replicas for a global DynamoDB table. | `any` | `[]` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/autoscaling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.72.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion examples/autoscaling/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
random = {
source = "hashicorp/random"
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.72.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
random = {
source = "hashicorp/random"
Expand Down
6 changes: 3 additions & 3 deletions examples/global-tables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Note that this example may create resources which can cost money (AWS Elastic IP
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.72.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.72.1 |
| <a name="provider_aws.euwest2"></a> [aws.euwest2](#provider\_aws.euwest2) | >= 5.72.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.98 |
| <a name="provider_aws.euwest2"></a> [aws.euwest2](#provider\_aws.euwest2) | >= 5.98 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.0 |

## Modules
Expand Down
2 changes: 1 addition & 1 deletion examples/global-tables/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
random = {
source = "hashicorp/random"
Expand Down
2 changes: 1 addition & 1 deletion examples/s3-import/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Note that this example may create resources which can cost money (AWS Elastic IP
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.72.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.98 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 2.0 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion examples/s3-import/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
random = {
source = "hashicorp/random"
Expand Down
9 changes: 6 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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" {
Expand Down Expand Up @@ -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" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
}
}
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, [])
Expand Down
2 changes: 1 addition & 1 deletion wrappers/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.72.1"
version = ">= 5.98"
}
}
}