Skip to content

Commit 01d3441

Browse files
authored
Merge pull request #112 from NHSDigital/feature/CCM-11352_test-template-events
CCM-11352: Force destory eventcache bucket and enable raw message delivery
2 parents 7eca858 + ff366a6 commit 01d3441

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

infrastructure/modules/eventpub/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
| <a name="input_data_plane_bus_arn"></a> [data\_plane\_bus\_arn](#input\_data\_plane\_bus\_arn) | Data plane event bus arn | `string` | n/a | yes |
1818
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | Default tag map for application to all taggable resources in the module | `map(string)` | `{}` | no |
1919
| <a name="input_enable_event_cache"></a> [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `false` | no |
20+
| <a name="input_enable_firehose_raw_message_delivery"></a> [enable\_firehose\_raw\_message\_delivery](#input\_enable\_firehose\_raw\_message\_delivery) | Enables raw message delivery on firehose subscription | `bool` | `false` | no |
2021
| <a name="input_enable_sns_delivery_logging"></a> [enable\_sns\_delivery\_logging](#input\_enable\_sns\_delivery\_logging) | Enable SNS Delivery Failure Notifications | `bool` | `false` | no |
2122
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the terraformscaffold environment the module is called for | `string` | n/a | yes |
2223
| <a name="input_event_cache_buffer_interval"></a> [event\_cache\_buffer\_interval](#input\_event\_cache\_buffer\_interval) | The buffer interval for data firehose | `number` | `500` | no |
2324
| <a name="input_event_cache_expiry_days"></a> [event\_cache\_expiry\_days](#input\_event\_cache\_expiry\_days) | s3 archiving expiry in days | `number` | `30` | no |
25+
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | When enabled will force destroy event-cache S3 bucket | `bool` | `false` | no |
2426
| <a name="input_group"></a> [group](#input\_group) | The name of the tfscaffold group | `string` | `null` | no |
2527
| <a name="input_iam_permissions_boundary_arn"></a> [iam\_permissions\_boundary\_arn](#input\_iam\_permissions\_boundary\_arn) | The ARN of the permissions boundary to use for the IAM role | `string` | `null` | no |
2628
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | KMS key arn to use for this function | `string` | n/a | yes |

infrastructure/modules/eventpub/module_s3bucket_event_cache.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module "s3bucket_event_cache" {
1212
component = var.component
1313

1414
acl = "private"
15-
force_destroy = false
15+
force_destroy = var.force_destroy
1616
versioning = true
1717

1818
lifecycle_rules = [

infrastructure/modules/eventpub/sns_topic_subscription_firehose.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ resource "aws_sns_topic_subscription" "firehose" {
55
protocol = "firehose"
66
subscription_role_arn = aws_iam_role.sns_role.arn
77
endpoint = aws_kinesis_firehose_delivery_stream.main[0].arn
8+
raw_message_delivery = var.enable_firehose_raw_message_delivery
89
}

infrastructure/modules/eventpub/variables.tf

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ variable "enable_sns_delivery_logging" {
7373
default = false
7474
}
7575

76-
77-
7876
variable "sns_success_logging_sample_percent" {
7977
type = number
8078
description = "Enable SNS Delivery Successful Sample Percentage"
@@ -99,6 +97,12 @@ variable "enable_event_cache" {
9997
default = false
10098
}
10199

100+
variable "enable_firehose_raw_message_delivery" {
101+
type = bool
102+
description = "Enables raw message delivery on firehose subscription"
103+
default = false
104+
}
105+
102106
variable "data_plane_bus_arn" {
103107
type = string
104108
description = "Data plane event bus arn"
@@ -114,3 +118,8 @@ variable "iam_permissions_boundary_arn" {
114118
description = "The ARN of the permissions boundary to use for the IAM role"
115119
default = null
116120
}
121+
variable "force_destroy" {
122+
type = bool
123+
description = "When enabled will force destroy event-cache S3 bucket"
124+
default = false
125+
}

0 commit comments

Comments
 (0)