File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -146,3 +146,22 @@ resource "aws_iam_role_policy" "lambda_github_webhooks_pulse" {
146
146
role = " ${ aws_iam_role . lambda_github_webhooks_pulse . id } "
147
147
policy = " ${ data . aws_iam_policy_document . lambda_github_webhooks_pulse . json } "
148
148
}
149
+
150
+ data "aws_iam_policy_document" "sns_webhooks_all" {
151
+ # Grant access to infosec-prod account.
152
+ statement = {
153
+ sid = " github_webhooks_all_infosec_subscribe"
154
+ effect = " Allow"
155
+ actions = [
156
+ " SNS:ListSubscriptionsByTopic" ,
157
+ " SNS:Subscribe" ,
158
+ ]
159
+ resources = [
160
+ " ${ aws_sns_topic . webhooks_all . arn } " ,
161
+ ]
162
+ principals {
163
+ type = " AWS"
164
+ identifiers = [" 371522382791" ]
165
+ }
166
+ }
167
+ }
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ resource "aws_sns_topic" "webhooks_all" {
2
2
name = " github-webhooks-all"
3
3
}
4
4
5
+ resource "aws_sns_topic_policy" "webhooks_all" {
6
+ arn = " ${ aws_sns_topic . webhooks_all . arn } "
7
+ policy = " ${ data . aws_iam_policy_document . sns_webhooks_all . json } "
8
+ }
9
+
5
10
resource "aws_sns_topic" "webhooks_public" {
6
11
name = " github-webhooks-public"
7
12
}
You can’t perform that action at this time.
0 commit comments