Skip to content

Commit 295a1d5

Browse files
authored
Modify mns publisher infra to account properly for test queue (#1288)
1 parent 0be8254 commit 295a1d5

12 files changed

Lines changed: 17 additions & 30 deletions

File tree

infrastructure/instance/dynamodb.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" {
6868
name = "imms-${local.resource_scope}-delta"
6969
billing_mode = "PAY_PER_REQUEST"
7070
hash_key = "PK"
71-
stream_enabled = var.mns_publisher_feature_enabled
72-
stream_view_type = var.mns_publisher_feature_enabled ? "NEW_IMAGE" : null
71+
stream_enabled = true
72+
stream_view_type = "NEW_IMAGE"
7373
deletion_protection_enabled = !local.is_temp
7474

7575
attribute {

infrastructure/instance/environments/dev/internal-qa/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ dspp_core_account_id = "603871901111"
44
pds_environment = "int"
55
mns_environment = "dev"
66
error_alarm_notifications_enabled = false
7-
mns_publisher_feature_enabled = true
87
create_mesh_processor = false
98
has_sub_environment_scope = true

infrastructure/instance/environments/dev/pr/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ dspp_core_account_id = "603871901111"
44
pds_environment = "int"
55
mns_environment = "dev"
66
error_alarm_notifications_enabled = false
7-
mns_publisher_feature_enabled = true # Switch this off once tested fully e2e in Lambda branch
87
create_mesh_processor = false
98
has_sub_environment_scope = true

infrastructure/instance/environments/preprod/int-blue/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dspp_core_account_id = "603871901111"
44
pds_environment = "int"
55
mns_environment = "int"
66
error_alarm_notifications_enabled = true
7-
mns_publisher_feature_enabled = true
87

98
# mesh no invocation period metric set to 3 days (in seconds) for preprod environment i.e 3 * 24 * 60 * 60
109
mesh_no_invocation_period_seconds = 259200

infrastructure/instance/environments/preprod/int-green/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dspp_core_account_id = "603871901111"
44
pds_environment = "int"
55
mns_environment = "int"
66
error_alarm_notifications_enabled = true
7-
mns_publisher_feature_enabled = true
87

98
# mesh no invocation period metric set to 3 days (in seconds) for preprod environment i.e 3 * 24 * 60 * 60
109
mesh_no_invocation_period_seconds = 259200

infrastructure/instance/environments/prod/blue/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mns_account_id = "758334270304"
55
pds_environment = "prod"
66
mns_environment = "prod"
77
error_alarm_notifications_enabled = true
8-
mns_publisher_feature_enabled = true
98

109
# mesh no invocation period metric set to 1 day (in seconds) for prod environment i.e 1 * 24 * 60 * 60
1110
mesh_no_invocation_period_seconds = 86400

infrastructure/instance/environments/prod/green/variables.tfvars

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mns_account_id = "758334270304"
55
pds_environment = "prod"
66
mns_environment = "prod"
77
error_alarm_notifications_enabled = true
8-
mns_publisher_feature_enabled = true
98

109
# mesh no invocation period metric set to 1 day (in seconds) for prod environment i.e 1 * 24 * 60 * 60
1110
mesh_no_invocation_period_seconds = 86400

infrastructure/instance/mns_publisher.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
module "mns_publisher" {
22
source = "./modules/mns_publisher"
3-
count = var.mns_publisher_feature_enabled ? 1 : 0
43

54
ddb_delta_stream_arn = aws_dynamodb_table.delta-dynamodb-table.stream_arn
65
dynamo_kms_encryption_key_arn = data.aws_kms_key.existing_dynamo_encryption_key.arn
7-
enable_lambda_alarm = var.error_alarm_notifications_enabled # consider just INT and PROD
6+
enable_lambda_alarm = var.error_alarm_notifications_enabled
87
immunisation_account_id = var.immunisation_account_id
98
is_temp = local.is_temp
109
enable_mns_test_queue = var.mns_environment == "dev"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "mns_test_queue_url" {
2+
value = var.enable_mns_test_queue ? aws_sqs_queue.mns_test_notification[0].url : null
3+
description = "URL of the MNS test notifications queue (DEV only)"
4+
}
5+
6+
output "mns_test_queue_arn" {
7+
value = var.enable_mns_test_queue ? aws_sqs_queue.mns_test_notification[0].arn : null
8+
description = "ARN of the MNS test notifications queue (DEV only)"
9+
}

infrastructure/instance/modules/mns_publisher/sqs_test_publish_mns.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,3 @@ resource "aws_sqs_queue_policy" "mns_test_notification_sqs" {
3333
queue_url = aws_sqs_queue.mns_test_notification[0].id
3434
policy = data.aws_iam_policy_document.mns_test_notification_sqs_policy[0].json
3535
}
36-
37-
output "mns_test_queue_url" {
38-
value = var.enable_mns_test_queue ? aws_sqs_queue.mns_test_notification[0].url : null
39-
description = "URL of the MNS test notifications queue"
40-
}
41-
42-
output "mns_test_queue_arn" {
43-
value = var.enable_mns_test_queue ? aws_sqs_queue.mns_test_notification[0].arn : null
44-
description = "ARN of the MNS test notifications queue"
45-
}

0 commit comments

Comments
 (0)