Skip to content

Commit 27d4368

Browse files
committed
Revert "Merge branch 'main' into feature/CCM-11965_letter-template-preview-content-changes"
This reverts commit 8d4dcb0, reversing changes made to 3c18a56.
1 parent 8d4dcb0 commit 27d4368

File tree

15 files changed

+7169
-897
lines changed

15 files changed

+7169
-897
lines changed

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module "backend_api" {
3131

3232
send_to_firehose = false
3333

34-
enable_routing_config_event_stream = true
34+
enable_event_stream = true
3535

3636
email_domain = local.email_domain
3737
template_submitted_sender_email_address = local.sandbox_letter_supplier_mock_template_submitted_sender

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ No requirements.
1616
| <a name="input_csi"></a> [csi](#input\_csi) | CSI from the parent component | `string` | n/a | yes |
1717
| <a name="input_email_domain"></a> [email\_domain](#input\_email\_domain) | Email domain | `string` | n/a | yes |
1818
| <a name="input_enable_backup"></a> [enable\_backup](#input\_enable\_backup) | Enable Backups for the DynamoDB table? | `bool` | `true` | no |
19-
| <a name="input_enable_routing_config_event_stream"></a> [enable\_routing\_config\_event\_stream](#input\_enable\_routing\_config\_event\_stream) | Enable DynamoDB streaming from routing config table to EventBridge | `bool` | `false` | no |
19+
| <a name="input_enable_event_stream"></a> [enable\_event\_stream](#input\_enable\_event\_stream) | Enable DynamoDB streaming to EventBridge | `bool` | `true` | no |
2020
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
2121
| <a name="input_function_s3_bucket"></a> [function\_s3\_bucket](#input\_function\_s3\_bucket) | Name of S3 bucket to upload lambda artefacts to | `string` | n/a | yes |
2222
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonmous with account short-name) | `string` | n/a | yes |
@@ -60,7 +60,6 @@ No requirements.
6060
| <a name="module_s3bucket_download"></a> [s3bucket\_download](#module\_s3bucket\_download) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-s3bucket.zip | n/a |
6161
| <a name="module_s3bucket_internal"></a> [s3bucket\_internal](#module\_s3bucket\_internal) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-s3bucket.zip | n/a |
6262
| <a name="module_s3bucket_quarantine"></a> [s3bucket\_quarantine](#module\_s3bucket\_quarantine) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-s3bucket.zip | n/a |
63-
| <a name="module_sqs_routing_config_table_events_pipe_dlq"></a> [sqs\_routing\_config\_table\_events\_pipe\_dlq](#module\_sqs\_routing\_config\_table\_events\_pipe\_dlq) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-sqs.zip | n/a |
6463
| <a name="module_sqs_sftp_upload"></a> [sqs\_sftp\_upload](#module\_sqs\_sftp\_upload) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-sqs.zip | n/a |
6564
| <a name="module_sqs_template_mgmt_events"></a> [sqs\_template\_mgmt\_events](#module\_sqs\_template\_mgmt\_events) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-sqs.zip | n/a |
6665
| <a name="module_sqs_template_table_events_pipe_dlq"></a> [sqs\_template\_table\_events\_pipe\_dlq](#module\_sqs\_template\_table\_events\_pipe\_dlq) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.20/terraform-sqs.zip | n/a |

infrastructure/terraform/modules/backend-api/cloudwatch_log_group_pipe_routing_config_table_events.tf

Lines changed: 0 additions & 5 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/module_lambda_event_publisher.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ module "lambda_event_publisher" {
2525
}
2626

2727
lambda_env_vars = {
28-
EVENT_SOURCE = "//notify.nhs.uk/${var.component}/${var.group}/${var.environment}"
29-
ROUTING_CONFIG_TABLE_NAME = aws_dynamodb_table.routing_configuration.name
30-
SNS_TOPIC_ARN = coalesce(var.sns_topic_arn, aws_sns_topic.main.arn)
31-
TEMPLATES_TABLE_NAME = aws_dynamodb_table.templates.name
28+
SNS_TOPIC_ARN = coalesce(var.sns_topic_arn, aws_sns_topic.main.arn)
29+
TEMPLATES_TABLE_NAME = aws_dynamodb_table.templates.name
30+
EVENT_SOURCE = "//notify.nhs.uk/${var.component}/${var.group}/${var.environment}"
3231
}
3332

3433
function_s3_bucket = var.function_s3_bucket

infrastructure/terraform/modules/backend-api/module_sqs_routing_config_table_events_pipe_dlq.tf

Lines changed: 0 additions & 11 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/pipes_pipe_routing_config_table_events.tf

Lines changed: 0 additions & 113 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/pipes_pipe_template_table_events.tf

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resource "aws_pipes_pipe" "template_table_events" {
55
role_arn = aws_iam_role.pipe_template_table_events.arn
66
source = aws_dynamodb_table.templates.stream_arn
77
target = module.sqs_template_mgmt_events.sqs_queue_arn
8-
desired_state = "RUNNING"
8+
desired_state = var.enable_event_stream ? "RUNNING" : "STOPPED"
99
kms_key_identifier = var.kms_key_arn
1010

1111
source_parameters {
@@ -24,15 +24,7 @@ resource "aws_pipes_pipe" "template_table_events" {
2424
}
2525

2626
target_parameters {
27-
input_template = <<-EOF
28-
{
29-
"dynamodb": <$.dynamodb>,
30-
"eventID": <$.eventID>,
31-
"eventName": <$.eventName>,
32-
"eventSource": <$.eventSource>,
33-
"tableName": "${aws_dynamodb_table.templates.name}"
34-
}
35-
EOF
27+
input_template = "{\"dynamodb\": <$.dynamodb>,\"eventID\": <$.eventID>,\"eventName\": <$.eventName>,\"eventSource\": <$.eventSource>,\"tableName\": \"${aws_dynamodb_table.templates.name}\"}"
3628

3729
sqs_queue_parameters {
3830
message_group_id = "$.dynamodb.Keys.id.S"
@@ -52,11 +44,11 @@ resource "aws_pipes_pipe" "template_table_events" {
5244

5345
resource "aws_iam_role" "pipe_template_table_events" {
5446
name = "${local.csi}-pipe-template-table-events"
55-
description = "IAM Role for Pipe to forward template table stream events to SQS"
56-
assume_role_policy = data.aws_iam_policy_document.pipes_templates_trust_policy.json
47+
description = "IAM Role for Pipe forward template table stream events to SQS"
48+
assume_role_policy = data.aws_iam_policy_document.pipes_trust_policy.json
5749
}
5850

59-
data "aws_iam_policy_document" "pipes_templates_trust_policy" {
51+
data "aws_iam_policy_document" "pipes_trust_policy" {
6052
statement {
6153
sid = "PipesAssumeRole"
6254
effect = "Allow"

infrastructure/terraform/modules/backend-api/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ variable "enable_backup" {
7171
default = true
7272
}
7373

74-
variable "enable_routing_config_event_stream" {
74+
variable "enable_event_stream" {
7575
type = bool
76-
description = "Enable DynamoDB streaming from routing config table to EventBridge"
77-
default = false
76+
description = "Enable DynamoDB streaming to EventBridge"
77+
default = true
7878
}
7979

8080
variable "kms_key_arn" {

0 commit comments

Comments
 (0)