Skip to content

Commit aef67db

Browse files
authored
Merge pull request #127 from NHSDigital/feature/CCM-12082_backup_retention
CCM-12082: Set backup retention and vault lock policy
2 parents 0a6f3cc + ef5c661 commit aef67db

5 files changed

Lines changed: 24 additions & 4 deletions

File tree

infrastructure/modules/aws-backup-source/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ No requirements.
7373
| <a name="input_restore_testing_plan_scheduled_expression"></a> [restore\_testing\_plan\_scheduled\_expression](#input\_restore\_testing\_plan\_scheduled\_expression) | Scheduled Expression of Recovery Selection Point | `string` | `"cron(0 1 ? * SUN *)"` | no |
7474
| <a name="input_restore_testing_plan_selection_window_days"></a> [restore\_testing\_plan\_selection\_window\_days](#input\_restore\_testing\_plan\_selection\_window\_days) | Selection window days | `number` | `7` | no |
7575
| <a name="input_restore_testing_plan_start_window"></a> [restore\_testing\_plan\_start\_window](#input\_restore\_testing\_plan\_start\_window) | Start window from the scheduled time during which the test should start | `number` | `1` | no |
76+
| <a name="input_vault_max_retention_days"></a> [vault\_max\_retention\_days](#input\_vault\_max\_retention\_days) | Maximum retention days for the vault lock | `number` | `35` | no |
77+
| <a name="input_vault_min_retention_days"></a> [vault\_min\_retention\_days](#input\_vault\_min\_retention\_days) | Minimum retention days for the vault lock | `number` | `7` | no |
7678
## Modules
7779

7880
No modules.

infrastructure/modules/aws-backup-source/backup_framework_dynamodb.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resource "aws_backup_framework" "dynamodb" {
4444

4545
input_parameter {
4646
name = "requiredRetentionDays"
47-
value = "35"
47+
value = "31"
4848
}
4949
}
5050

@@ -65,7 +65,7 @@ resource "aws_backup_framework" "dynamodb" {
6565

6666
input_parameter {
6767
name = "requiredRetentionDays"
68-
value = "35"
68+
value = "31"
6969
}
7070

7171
input_parameter {

infrastructure/modules/aws-backup-source/backup_framework_s3.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resource "aws_backup_framework" "s3" {
4444

4545
input_parameter {
4646
name = "requiredRetentionDays"
47-
value = "35"
47+
value = "31"
4848
}
4949
}
5050

@@ -65,7 +65,7 @@ resource "aws_backup_framework" "s3" {
6565

6666
input_parameter {
6767
name = "requiredRetentionDays"
68-
value = "35"
68+
value = "31"
6969
}
7070

7171
input_parameter {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
resource "aws_backup_vault_lock_configuration" "main" {
2+
backup_vault_name = aws_backup_vault.main.name
3+
changeable_for_days = 30
4+
max_retention_days = var.vault_max_retention_days
5+
min_retention_days = var.vault_min_retention_days
6+
}

infrastructure/modules/aws-backup-source/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,15 @@ variable "backup_plan_config_dynamodb" {
221221
]
222222
}
223223
}
224+
225+
variable "vault_max_retention_days" {
226+
type = number
227+
description = "Maximum retention days for the vault lock"
228+
default = 35
229+
}
230+
231+
variable "vault_min_retention_days" {
232+
type = number
233+
description = "Minimum retention days for the vault lock"
234+
default = 7
235+
}

0 commit comments

Comments
 (0)