Skip to content

Commit 7f5d1e6

Browse files
CCM-7890 Update backup template resources, there is no S3 backup needed yet
1 parent bc6de2e commit 7f5d1e6

File tree

4 files changed

+11
-31
lines changed

4 files changed

+11
-31
lines changed

infrastructure/terraform/components/app/module_nhse_backup_vault.tf

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module "nhse_backup_vault" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source?ref=v1.0.6"
2+
# source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/aws-backup-source?ref=v1.0.6"
3+
source = "/Users/aiden.vaines/Clients/NHS/notify/nhs-notify-shared-modules/infrastructure/modules/aws-backup-source"
34
count = var.destination_vault_arn != null ? 1:0
45

56
project_name = local.csi
@@ -10,49 +11,28 @@ module "nhse_backup_vault" {
1011

1112
reports_bucket = local.acct.s3_buckets["backup_reports"]["bucket"]
1213
notifications_target_email_address = var.backup_report_recipient
14+
notification_kms_key = module.kms.key_id
1315

14-
bootstrap_kms_key_arn = module.kms.key_id
15-
terraform_role_arn = local.bootstrap.iam_github_deploy_role["arn"]
16+
management_ci_role_arn = local.bootstrap.iam_github_deploy_role["arn"]
1617

17-
backup_plan_config = {
18-
"compliance_resource_types": [
19-
"S3"
20-
],
21-
"rules": [
22-
{
23-
"copy_action": {
24-
"delete_after": var.retention_period
25-
},
26-
"lifecycle": {
27-
"delete_after": var.retention_period
28-
},
29-
"name": "${local.csi}-backup-rule",
30-
"schedule": var.backup_schedule_cron
31-
}
32-
],
33-
"selection_tag": "NHSE-Enable-Backup"
34-
}
35-
36-
# Note here that we need to explicitly disable DynamoDB backups in the source account.
37-
# The default config in the module enables backups for all resource types.
3818
backup_plan_config_dynamodb = {
3919
"compliance_resource_types": [
4020
"DynamoDB"
4121
],
4222
"rules": [
4323
{
24+
"name": "${local.csi}-backup-rule",
25+
"schedule": var.backup_schedule_cron,
4426
"copy_action": {
4527
"delete_after": var.retention_period
4628
},
4729
"lifecycle": {
4830
"delete_after": var.retention_period
49-
},
50-
"name": "${local.csi}-backup-rule",
51-
"schedule": var.backup_schedule_cron
31+
}
5232
}
5333
],
5434
"enable": true,
55-
"selection_tag": "NHSE-Enable-Backup"
35+
"selection_tag": "NHSE-Enable-Dynamo-Backup"
5636
}
5737
}
5838

infrastructure/terraform/modules/backend-api/dynamodb_table_templates.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ resource "aws_dynamodb_table" "templates" {
3030
}
3131

3232
tags = {
33-
"NHSE-Enable-Backup" = var.enable_backup ? "True": "False"
33+
"NHSE-Enable-Dynamo-Backup" = var.enable_backup ? "True": "False"
3434
}
3535
}

scripts/terraform/terraform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ terraform-sec: # TFSEC check against Terraform files - optional: terraform_dir|d
6161
--exclude-downloaded-modules \
6262
--tfvars-file infrastructure/terraform/etc/global.tfvars \
6363
--tfvars-file infrastructure/terraform/etc/env_eu-west-2_main.tfvars \
64-
--config-file scripts/config/tfsec.yml
64+
--config-file scripts/config/tfsec.yaml
6565

6666
# ==============================================================================
6767
# Module tests and examples - please DO NOT edit this section!

scripts/terraform/tfsec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function run-tfsec-natively() {
3939
tfsec \
4040
--force-all-dirs \
4141
--exclude-downloaded-modules \
42-
--config-file scripts/config/tfsec.yml \
42+
--config-file scripts/config/tfsec.yaml \
4343
--format text \
4444
"$dir_to_scan"
4545

0 commit comments

Comments
 (0)