Skip to content

Commit f89fb8b

Browse files
authored
Merge pull request #147 from NHSDigital/feature/CCM-12958_sechub
CCM-12958: Additional policies for eventcache bucket in eventpub
2 parents 840b62b + 6ec15d9 commit f89fb8b

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

infrastructure/modules/eventpub/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
| Name | Description | Type | Default | Required |
1313
|------|-------------|------|---------|:--------:|
14+
| <a name="input_additional_policies_for_event_cache_bucket"></a> [additional\_policies\_for\_event\_cache\_bucket](#input\_additional\_policies\_for\_event\_cache\_bucket) | A list of JSON policies to use to build the bucket policy | `list(string)` | `[]` | no |
1415
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | The AWS Account ID (numeric) | `string` | n/a | yes |
1516
| <a name="input_component"></a> [component](#input\_component) | The name of the terraformscaffold component calling this module | `string` | n/a | yes |
1617
| <a name="input_control_plane_bus_arn"></a> [control\_plane\_bus\_arn](#input\_control\_plane\_bus\_arn) | Data plane event bus arn | `string` | n/a | yes |
@@ -36,7 +37,7 @@
3637

3738
| Name | Source | Version |
3839
|------|--------|---------|
39-
| <a name="module_s3bucket_event_cache"></a> [s3bucket\_event\_cache](#module\_s3bucket\_event\_cache) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
40+
| <a name="module_s3bucket_event_cache"></a> [s3bucket\_event\_cache](#module\_s3bucket\_event\_cache) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.30/terraform-s3bucket.zip | n/a |
4041
## Outputs
4142

4243
| Name | Description |

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)