Skip to content

Commit aa192d1

Browse files
stevebuxnhsd-david-wass
authored andcommitted
Rename "main" SNS topic to "eventsub_topic"
1 parent ae1d0da commit aa192d1

10 files changed

Lines changed: 26 additions & 15 deletions

infrastructure/terraform/components/api/module_lambda_amendment_event_transformer.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ data "aws_iam_policy_document" "amendment_event_transformer" {
105105
]
106106

107107
resources = [
108-
module.eventsub.sns_topic.arn
108+
module.eventsub.eventsub_topic.arn
109109
]
110110
}
111111
}

infrastructure/terraform/components/api/module_sqs_letter_updates.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ data "aws_iam_policy_document" "letter_updates_queue_policy" {
3838
condition {
3939
test = "ArnEquals"
4040
variable = "aws:SourceArn"
41-
values = [module.eventsub.sns_topic.arn]
41+
values = [module.eventsub.eventsub_topic.arn]
4242
}
4343
}
4444

@@ -65,7 +65,7 @@ data "aws_iam_policy_document" "letter_updates_queue_policy" {
6565
condition {
6666
test = "ArnEquals"
6767
variable = "aws:SourceArn"
68-
values = [module.eventsub.sns_topic.arn]
68+
values = [module.eventsub.eventsub_topic.arn]
6969
}
7070
}
7171
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_sns_topic_subscription" "eventsub_sqs_letter_updates" {
2-
topic_arn = module.eventsub.sns_topic.arn
2+
topic_arn = module.eventsub.eventsub_topic.arn
33
protocol = "sqs"
44
endpoint = module.sqs_letter_updates.sqs_queue_arn
55
}

infrastructure/terraform/modules/eventsub/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
| Name | Description |
4242
|------|-------------|
43+
| <a name="output_eventsub_topic"></a> [eventsub\_topic](#output\_eventsub\_topic) | SNS Topic ARN and Name |
4344
| <a name="output_s3_bucket_event_cache"></a> [s3\_bucket\_event\_cache](#output\_s3\_bucket\_event\_cache) | S3 Bucket ARN and Name for event cache |
44-
| <a name="output_sns_topic"></a> [sns\_topic](#output\_sns\_topic) | SNS Topic ARN and Name |
4545
<!-- vale on -->
4646
<!-- markdownlint-enable -->
4747
<!-- END_TF_DOCS -->

infrastructure/terraform/modules/eventsub/cloudwatch_metric_alarm_sns_delivery_failures.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ resource "aws_cloudwatch_metric_alarm" "sns_delivery_failures" {
1111
treat_missing_data = "notBreaching"
1212

1313
dimensions = {
14-
TopicName = aws_sns_topic.main.name
14+
TopicName = aws_sns_topic.eventsub_topic.name
1515
}
1616
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Moved blocks to handle resource renames without destroy/recreate
2+
3+
moved {
4+
from = aws_sns_topic.main
5+
to = aws_sns_topic.eventsub_topic
6+
}
7+
8+
moved {
9+
from = aws_sns_topic_policy.main
10+
to = aws_sns_topic_policy.eventsub_topic
11+
}

infrastructure/terraform/modules/eventsub/outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
output "sns_topic" {
1+
output "eventsub_topic" {
22
description = "SNS Topic ARN and Name"
33
value = {
4-
arn = aws_sns_topic.main.arn
5-
name = aws_sns_topic.main.name
4+
arn = aws_sns_topic.eventsub_topic.arn
5+
name = aws_sns_topic.eventsub_topic.name
66
}
77
}
88

infrastructure/terraform/modules/eventsub/sns_topic.tf renamed to infrastructure/terraform/modules/eventsub/sns_topic_eventsub.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resource "aws_sns_topic" "main" {
1+
resource "aws_sns_topic" "eventsub_topic" {
22
name = local.csi
33
kms_master_key_id = var.kms_key_arn
44

infrastructure/terraform/modules/eventsub/sns_topic_policy.tf renamed to infrastructure/terraform/modules/eventsub/sns_topic_policy_eventsub.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
resource "aws_sns_topic_policy" "main" {
2-
arn = aws_sns_topic.main.arn
1+
resource "aws_sns_topic_policy" "eventsub_topic" {
2+
arn = aws_sns_topic.eventsub_topic.arn
33

44
policy = data.aws_iam_policy_document.sns_topic_policy.json
55
}
@@ -29,7 +29,7 @@ data "aws_iam_policy_document" "sns_topic_policy" {
2929
]
3030

3131
resources = [
32-
aws_sns_topic.main.arn,
32+
aws_sns_topic.eventsub_topic.arn,
3333
]
3434

3535
condition {
@@ -57,7 +57,7 @@ data "aws_iam_policy_document" "sns_topic_policy" {
5757
}
5858

5959
resources = [
60-
aws_sns_topic.main.arn,
60+
aws_sns_topic.eventsub_topic.arn,
6161
]
6262
}
6363
}

infrastructure/terraform/modules/eventsub/sns_topic_subscription_firehose.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "aws_sns_topic_subscription" "firehose" {
22
count = var.enable_event_cache ? 1 : 0
33

4-
topic_arn = aws_sns_topic.main.arn
4+
topic_arn = aws_sns_topic.eventsub_topic.arn
55
protocol = "firehose"
66
subscription_role_arn = aws_iam_role.sns_role.arn
77
endpoint = aws_kinesis_firehose_delivery_stream.main[0].arn

0 commit comments

Comments
 (0)