diff --git a/infrastructure/terraform/components/api/README.md b/infrastructure/terraform/components/api/README.md
index e2eac9acd..0f72aaf22 100644
--- a/infrastructure/terraform/components/api/README.md
+++ b/infrastructure/terraform/components/api/README.md
@@ -17,6 +17,8 @@ No requirements.
| [core\_environment](#input\_core\_environment) | Environment of Core | `string` | `"prod"` | no |
| [default\_tags](#input\_default\_tags) | A map of default tags to apply to all taggable resources within the component | `map(string)` | `{}` | no |
| [disable\_gateway\_execute\_endpoint](#input\_disable\_gateway\_execute\_endpoint) | Disable the execution endpoint for the API Gateway | `bool` | `true` | no |
+| [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `false` | no |
+| [enable\_sns\_delivery\_logging](#input\_enable\_sns\_delivery\_logging) | Enable SNS Delivery Failure Notifications | `bool` | `false` | no |
| [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
| [eventpub\_control\_plane\_bus\_arn](#input\_eventpub\_control\_plane\_bus\_arn) | ARN of the EventBridge control plane bus for eventpub | `string` | `""` | no |
| [eventpub\_data\_plane\_bus\_arn](#input\_eventpub\_data\_plane\_bus\_arn) | ARN of the EventBridge data plane bus for eventpub | `string` | `""` | no |
@@ -34,6 +36,7 @@ No requirements.
| [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
| [region](#input\_region) | The AWS Region | `string` | n/a | yes |
| [shared\_infra\_account\_id](#input\_shared\_infra\_account\_id) | The AWS Account ID of the shared infrastructure account | `string` | `"000000000000"` | no |
+| [sns\_success\_logging\_sample\_percent](#input\_sns\_success\_logging\_sample\_percent) | Enable SNS Delivery Successful Sample Percentage | `number` | `0` | no |
## Modules
| Name | Source | Version |
diff --git a/infrastructure/terraform/components/api/modules_eventpub.tf b/infrastructure/terraform/components/api/modules_eventpub.tf
index e4d174ba3..f3090b111 100644
--- a/infrastructure/terraform/components/api/modules_eventpub.tf
+++ b/infrastructure/terraform/components/api/modules_eventpub.tf
@@ -19,11 +19,11 @@ module "eventpub" {
force_destroy = var.force_destroy
event_cache_buffer_interval = 500
- enable_sns_delivery_logging = true
- sns_success_logging_sample_percent = 0
+ enable_sns_delivery_logging = var.enable_sns_delivery_logging
+ sns_success_logging_sample_percent = var.sns_success_logging_sample_percent
event_cache_expiry_days = 30
- enable_event_cache = true
+ enable_event_cache = var.enable_event_cache
data_plane_bus_arn = var.eventpub_data_plane_bus_arn
control_plane_bus_arn = var.eventpub_control_plane_bus_arn
diff --git a/infrastructure/terraform/components/api/modules_eventsub.tf b/infrastructure/terraform/components/api/modules_eventsub.tf
index dcd58fdf9..c55be96c0 100644
--- a/infrastructure/terraform/components/api/modules_eventsub.tf
+++ b/infrastructure/terraform/components/api/modules_eventsub.tf
@@ -18,9 +18,11 @@ module "eventsub" {
force_destroy = var.force_destroy
event_cache_buffer_interval = 500
- enable_sns_delivery_logging = true
- sns_success_logging_sample_percent = 0
+ enable_sns_delivery_logging = var.enable_sns_delivery_logging
+ sns_success_logging_sample_percent = var.sns_success_logging_sample_percent
event_cache_expiry_days = 30
+ enable_event_cache = var.enable_event_cache
+
shared_infra_account_id = var.shared_infra_account_id
}
diff --git a/infrastructure/terraform/components/api/variables.tf b/infrastructure/terraform/components/api/variables.tf
index 9ba8849f8..9785ec00b 100644
--- a/infrastructure/terraform/components/api/variables.tf
+++ b/infrastructure/terraform/components/api/variables.tf
@@ -162,3 +162,22 @@ variable "core_environment" {
default = "prod"
}
+
+# Event Pub/Sub cache settings
+variable "enable_event_cache" {
+ type = bool
+ description = "Enable caching of events to an S3 bucket"
+ default = false
+}
+
+variable "enable_sns_delivery_logging" {
+ type = bool
+ description = "Enable SNS Delivery Failure Notifications"
+ default = false
+}
+
+variable "sns_success_logging_sample_percent" {
+ type = number
+ description = "Enable SNS Delivery Successful Sample Percentage"
+ default = 0
+}
diff --git a/infrastructure/terraform/modules/eventsub/README.md b/infrastructure/terraform/modules/eventsub/README.md
index a5653fda3..859c5fd5b 100644
--- a/infrastructure/terraform/modules/eventsub/README.md
+++ b/infrastructure/terraform/modules/eventsub/README.md
@@ -34,7 +34,7 @@
| Name | Source | Version |
|------|--------|---------|
-| [s3bucket\_event\_cache](#module\_s3bucket\_event\_cache) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
+| [s3bucket\_event\_cache](#module\_s3bucket\_event\_cache) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-s3bucket.zip | n/a |
## Outputs
| Name | Description |
diff --git a/infrastructure/terraform/modules/eventsub/module_s3bucket_event_cache.tf b/infrastructure/terraform/modules/eventsub/module_s3bucket_event_cache.tf
index 7a5d62f37..f042c2d22 100644
--- a/infrastructure/terraform/modules/eventsub/module_s3bucket_event_cache.tf
+++ b/infrastructure/terraform/modules/eventsub/module_s3bucket_event_cache.tf
@@ -1,5 +1,5 @@
module "s3bucket_event_cache" {
- source = "git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket?ref=v1.0.8"
+ source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.26/terraform-s3bucket.zip"
count = var.enable_event_cache ? 1 : 0