Skip to content

Commit ebca785

Browse files
stevebuxnhsd-david-wass
authored andcommitted
Revert "Add new amendments SNS topic"
This reverts commit 3c85424.
1 parent f8aae73 commit ebca785

6 files changed

Lines changed: 1 addition & 126 deletions

File tree

infrastructure/terraform/modules/eventsub/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
| Name | Description |
4242
|------|-------------|
43-
| <a name="output_amendments_topic"></a> [amendments\_topic](#output\_amendments\_topic) | Amendments SNS Topic ARN and Name |
4443
| <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 |
4544
| <a name="output_sns_topic"></a> [sns\_topic](#output\_sns\_topic) | SNS Topic ARN and Name |
4645
<!-- vale on -->

infrastructure/terraform/modules/eventsub/cloudwatch_metric_alarm_sns_delivery_failures.tf

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,3 @@ resource "aws_cloudwatch_metric_alarm" "sns_delivery_failures" {
1414
TopicName = aws_sns_topic.main.name
1515
}
1616
}
17-
18-
resource "aws_cloudwatch_metric_alarm" "amendments_delivery_failures" {
19-
alarm_name = "${local.csi}-amendments-sns-delivery-failures"
20-
alarm_description = "RELIABILITY: Alarm for amendments SNS topic delivery failures"
21-
comparison_operator = "GreaterThanThreshold"
22-
evaluation_periods = 1
23-
metric_name = "NumberOfNotificationsFailed"
24-
namespace = "AWS/SNS"
25-
period = 300
26-
statistic = "Sum"
27-
threshold = 0
28-
treat_missing_data = "notBreaching"
29-
30-
dimensions = {
31-
TopicName = aws_sns_topic.amendments_topic.name
32-
}
33-
}

infrastructure/terraform/modules/eventsub/outputs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ output "sns_topic" {
66
}
77
}
88

9-
output "amendments_topic" {
10-
description = "Amendments SNS Topic ARN and Name"
11-
value = {
12-
arn = aws_sns_topic.amendments_topic.arn
13-
name = aws_sns_topic.amendments_topic.name
14-
}
15-
}
16-
179
output "s3_bucket_event_cache" {
1810
description = "S3 Bucket ARN and Name for event cache"
1911
value = var.enable_event_cache ? {

infrastructure/terraform/modules/eventsub/sns_topic.tf

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,3 @@ resource "aws_sns_topic" "main" {
2222
sqs_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
2323
sqs_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
2424
}
25-
26-
resource "aws_sns_topic" "amendments_topic" {
27-
name = "${local.csi}-amendments"
28-
kms_master_key_id = var.kms_key_arn
29-
30-
application_failure_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
31-
application_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
32-
application_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
33-
34-
firehose_failure_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
35-
firehose_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
36-
firehose_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
37-
38-
http_failure_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
39-
http_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
40-
http_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
41-
42-
lambda_failure_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
43-
lambda_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
44-
lambda_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
45-
46-
sqs_failure_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
47-
sqs_success_feedback_role_arn = var.enable_sns_delivery_logging == true ? aws_iam_role.sns_delivery_logging_role[0].arn : null
48-
sqs_success_feedback_sample_rate = var.enable_sns_delivery_logging == true ? var.sns_success_logging_sample_percent : null
49-
}

infrastructure/terraform/modules/eventsub/sns_topic_policy.tf

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ resource "aws_sns_topic_policy" "main" {
44
policy = data.aws_iam_policy_document.sns_topic_policy.json
55
}
66

7-
resource "aws_sns_topic_policy" "amendments_topic" {
8-
arn = aws_sns_topic.amendments_topic.arn
9-
10-
policy = data.aws_iam_policy_document.amendments_topic_policy.json
11-
}
12-
137
data "aws_iam_policy_document" "sns_topic_policy" {
148
policy_id = "__default_policy_ID"
159

@@ -67,61 +61,3 @@ data "aws_iam_policy_document" "sns_topic_policy" {
6761
]
6862
}
6963
}
70-
71-
data "aws_iam_policy_document" "amendments_topic_policy" {
72-
policy_id = "__default_policy_ID"
73-
74-
statement {
75-
sid = "AllowAllSNSActionsFromAccount"
76-
effect = "Allow"
77-
78-
principals {
79-
type = "AWS"
80-
identifiers = ["*"]
81-
}
82-
83-
actions = [
84-
"SNS:Subscribe",
85-
"SNS:SetTopicAttributes",
86-
"SNS:RemovePermission",
87-
"SNS:Receive",
88-
"SNS:Publish",
89-
"SNS:ListSubscriptionsByTopic",
90-
"SNS:GetTopicAttributes",
91-
"SNS:DeleteTopic",
92-
"SNS:AddPermission",
93-
]
94-
95-
resources = [
96-
aws_sns_topic.eventsub_topic.arn,
97-
]
98-
99-
condition {
100-
test = "StringEquals"
101-
variable = "AWS:SourceOwner"
102-
103-
values = [
104-
var.aws_account_id,
105-
]
106-
}
107-
}
108-
109-
statement {
110-
sid = "AllowAllSNSActionsFromSharedAccount"
111-
effect = "Allow"
112-
actions = [
113-
"SNS:Publish",
114-
]
115-
116-
principals {
117-
type = "AWS"
118-
identifiers = [
119-
"arn:aws:iam::${var.shared_infra_account_id}:root"
120-
]
121-
}
122-
123-
resources = [
124-
aws_sns_topic.amendments_topic.arn,
125-
]
126-
}
127-
}
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resource "aws_sns_topic_subscription" "firehose_eventsub" {
1+
resource "aws_sns_topic_subscription" "firehose" {
22
count = var.enable_event_cache ? 1 : 0
33

44
topic_arn = aws_sns_topic.main.arn
@@ -7,13 +7,3 @@ resource "aws_sns_topic_subscription" "firehose_eventsub" {
77
endpoint = aws_kinesis_firehose_delivery_stream.main[0].arn
88
raw_message_delivery = var.enable_firehose_raw_message_delivery
99
}
10-
11-
resource "aws_sns_topic_subscription" "firehose_amendments" {
12-
count = var.enable_event_cache ? 1 : 0
13-
14-
topic_arn = aws_sns_topic.amendments_topic.arn
15-
protocol = "firehose"
16-
subscription_role_arn = aws_iam_role.sns_role.arn
17-
endpoint = aws_kinesis_firehose_delivery_stream.main[0].arn
18-
raw_message_delivery = var.enable_firehose_raw_message_delivery
19-
}

0 commit comments

Comments
 (0)