Skip to content

Commit d28ccb2

Browse files
cparmarmaximmiactions-botaknysh
authored
Add option to enable point in time recovery for DynamoDB tables (#35)
* Add option to enable point in time recovery for DynamoDB tables * Updated README.md * Update variables.tf Co-Authored-By: Andriy Knysh <aknysh@users.noreply.github.com> * Updated README.md Co-authored-by: Maxim Mironenko <simixido@gmail.com> Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com> Co-authored-by: Andriy Knysh <aknysh@users.noreply.github.com>
1 parent 6c3353f commit d28ccb2

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Available targets:
165165
| block_public_policy | Whether Amazon S3 should block public bucket policies for this bucket | string | `true` | no |
166166
| context | Default context to use for passing state between label invocations | object | `<map>` | no |
167167
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
168+
| enable_point_in_time_recovery | Enable DynamoDB point-in-time recovery | bool | `false` | no |
168169
| enable_server_side_encryption | Enable DynamoDB server-side encryption | bool | `true` | no |
169170
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
170171
| force_destroy | A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | bool | `false` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
| block_public_policy | Whether Amazon S3 should block public bucket policies for this bucket | string | `true` | no |
1010
| context | Default context to use for passing state between label invocations | object | `<map>` | no |
1111
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
12+
| enable_point_in_time_recovery | Enable DynamoDB point-in-time recovery | bool | `false` | no |
1213
| enable_server_side_encryption | Enable DynamoDB server-side encryption | bool | `true` | no |
1314
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
1415
| force_destroy | A boolean that indicates the S3 bucket can be destroyed even if it contains objects. These objects are not recoverable | bool | `false` | no |

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ resource "aws_dynamodb_table" "with_server_side_encryption" {
143143
enabled = true
144144
}
145145

146+
point_in_time_recovery {
147+
enabled = var.enable_point_in_time_recovery
148+
}
149+
146150
lifecycle {
147151
ignore_changes = [
148152
read_capacity,
@@ -167,6 +171,10 @@ resource "aws_dynamodb_table" "without_server_side_encryption" {
167171
# https://www.terraform.io/docs/backends/types/s3.html#dynamodb_table
168172
hash_key = "LockID"
169173

174+
point_in_time_recovery {
175+
enabled = var.enable_point_in_time_recovery
176+
}
177+
170178
lifecycle {
171179
ignore_changes = [
172180
read_capacity,

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ variable "mfa_delete" {
115115
default = false
116116
}
117117

118+
variable "enable_point_in_time_recovery" {
119+
type = bool
120+
description = "Enable DynamoDB point-in-time recovery"
121+
default = false
122+
}
123+
118124
variable "enable_server_side_encryption" {
119125
type = bool
120126
description = "Enable DynamoDB server-side encryption"

0 commit comments

Comments
 (0)