Skip to content

Commit dad2b2e

Browse files
committed
CCM-12958: Additional policies for eventcache bucket in eventpub
1 parent 840b62b commit dad2b2e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

infrastructure/modules/eventpub/module_s3bucket_event_cache.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "s3bucket_event_cache" {
2-
source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v1.0.8"
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.30/terraform-s3bucket.zip"
33

44
count = var.enable_event_cache ? 1 : 0
55

@@ -36,9 +36,10 @@ module "s3bucket_event_cache" {
3636
}
3737
]
3838

39-
policy_documents = [
40-
data.aws_iam_policy_document.s3bucket_event_cache[0].json
41-
]
39+
policy_documents = concat(
40+
[data.aws_iam_policy_document.s3bucket_event_cache[0].json],
41+
var.additional_policies_for_event_cache_bucket
42+
)
4243

4344
public_access = {
4445
block_public_acls = true

infrastructure/modules/eventpub/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,9 @@ variable "force_destroy" {
123123
description = "When enabled will force destroy event-cache S3 bucket"
124124
default = false
125125
}
126+
127+
variable "additional_policies_for_event_cache_bucket" {
128+
type = list(string)
129+
description = "A list of JSON policies to use to build the bucket policy"
130+
default = []
131+
}

0 commit comments

Comments
 (0)