Skip to content

Commit 0347b77

Browse files
committed
CCM-9037: add acct sandbox kms key, quarantine s3 bucket
1 parent d72a14d commit 0347b77

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

infrastructure/terraform/components/sandbox/module_kms.tf renamed to infrastructure/terraform/components/acct/module_sandbox_kms.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module "kms" {
1+
module "kms_sandbox" {
22
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/kms?ref=v1.0.8"
33

44
aws_account_id = var.aws_account_id
@@ -7,7 +7,7 @@ module "kms" {
77
project = var.project
88
region = var.region
99

10-
name = "main"
10+
name = "sandbox"
1111
deletion_window = var.kms_deletion_window
12-
alias = "alias/${local.csi}"
12+
alias = "alias/${local.csi}-sandbox"
1313
}

infrastructure/terraform/components/acct/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,15 @@ variable "initial_cli_secrets_provision_override" {
7070
# Usage like:
7171
# ... -a apply -- -var initial_cli_secrets_provision_override={\"github_pat\":\"l0ngstr1ng"}
7272
}
73+
74+
variable "kms_deletion_window" {
75+
type = string
76+
description = "When a kms key is deleted, how long should it wait in the pending deletion state?"
77+
default = "30"
78+
}
79+
80+
variable "support_sandbox_environments" {
81+
type = bool
82+
description = "Does this account support dev sandbox environments?"
83+
default = false
84+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "aws_kms_key" "sandbox" {
2+
key_id = "${var.project}-main-acct-sandbox"
3+
}

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ module "backend_api" {
66
aws_account_id = var.aws_account_id
77
region = var.region
88
group = var.group
9+
component = var.component
910
csi = local.csi
1011
log_retention_in_days = var.log_retention_in_days
1112

13+
1214
cognito_config = {
1315
USER_POOL_ID = aws_cognito_user_pool.sandbox.id
1416
USER_POOL_CLIENT_ID = aws_cognito_user_pool_client.sandbox.id
1517
}
1618

1719
enable_letters = true
1820

19-
kms_key_arn = module.kms.key_arn
21+
kms_key_arn = data.aws_kms_key.sandbox.arn
2022
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module "s3bucket_quarantine" {
2+
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v1.0.8"
3+
4+
name = "quarantine"
5+
6+
aws_account_id = var.aws_account_id
7+
region = var.region
8+
project = var.project
9+
environment = var.environment
10+
component = var.component
11+
12+
kms_key_arn = var.kms_key_arn
13+
}

0 commit comments

Comments
 (0)