Skip to content

Commit eed5022

Browse files
Merge pull request #768 from NHSDigital/feature/made14-NRL-853-fixup-s3-bucket-tags
[NRL-853] Fixup S3 bucket tag values
2 parents 8c5a628 + c62a993 commit eed5022

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

terraform/account-wide-infrastructure/dev/aws-backup.tf

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ resource "aws_s3_bucket_acl" "backup_reports" {
6464
acl = "private"
6565
}
6666

67-
# We need a key for the SNS topic that will be used for notifications from AWS Backup. This key
68-
# will be used to encrypt the messages sent to the topic before they are sent to the subscribers,
69-
# but isn't needed by the recipients of the messages.
70-
71-
# First we need some contextual data
72-
data "aws_caller_identity" "current" {}
73-
data "aws_region" "current" {}
74-
75-
# Now we can define the key itself
7667
resource "aws_kms_key" "backup_notifications" {
7768
description = "KMS key for AWS Backup notifications"
7869
deletion_window_in_days = 7
@@ -101,8 +92,6 @@ resource "aws_kms_key" "backup_notifications" {
10192
})
10293
}
10394

104-
# Now we can deploy the source and destination modules, referencing the resources we've created above.
105-
10695
module "source" {
10796
source = "../modules/backup-source"
10897

terraform/account-wide-infrastructure/modules/backup-source/backup_plan.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ resource "aws_backup_selection" "dynamodb" {
8282
selection_tag {
8383
key = var.backup_plan_config_dynamodb.selection_tag
8484
type = "STRINGEQUALS"
85-
value = "true"
85+
value = "True"
8686
}
8787
}

terraform/account-wide-infrastructure/modules/permissions-store-bucket/s3.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resource "aws_s3_bucket" "authorization-store" {
55
tags = {
66
Name = "authorization store"
77
Environment = "${var.name_prefix}"
8-
NHSE-Enable-S3-Backup = "${var.enable_backups}"
8+
NHSE-Enable-S3-Backup = var.enable_backups ? "True" : "False"
99
}
1010
}
1111

terraform/account-wide-infrastructure/modules/pointers-table/dynamodb.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ resource "aws_dynamodb_table" "pointers" {
5252
enabled = var.enable_pitr
5353
}
5454

55-
tags = { NHSE-Enable-DDB-Backup = "${var.enable_backups}" }
55+
tags = {
56+
NHSE-Enable-DDB-Backup = var.enable_backups ? "True" : "False"
57+
}
5658
}

terraform/account-wide-infrastructure/modules/truststore-bucket/s3.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
resource "aws_s3_bucket" "api_truststore" {
22
bucket = "${var.name_prefix}-api-truststore"
33
force_destroy = var.enable_bucket_force_destroy
4-
tags = { NHSE-Enable-S3-Backup = "${var.enable_backups}" }
4+
tags = {
5+
NHSE-Enable-S3-Backup = var.enable_backups ? "True" : "False"
6+
}
57
}
68

79
resource "aws_s3_bucket_policy" "api_truststore_bucket_policy" {

0 commit comments

Comments
 (0)