Skip to content

Commit b1451be

Browse files
committed
fix: add SnsRole for topic publish
1 parent 50fdcb2 commit b1451be

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

template.yaml.tpl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,30 @@ Resources:
262262
Enabled: true
263263
LogGroupName: /aws/kinesisfirehose/apm-dlq-stream
264264
LogStreamName: DestinationDelivery
265+
# SNS role so that opensearch can publish to topics
266+
SnsRole:
267+
Type: AWS::IAM::Role
268+
Properties:
269+
RoleName: "opensearch_sns_nress-prod"
270+
AssumeRolePolicyDocument:
271+
Version: "2012-10-17"
272+
Statement:
273+
Sid: "",
274+
Effect: "Allow"
275+
Principal: {
276+
Service: "es.amazonaws.com"
277+
},
278+
"Action": "sts:AssumeRole"
279+
Policies:
280+
- PolicyName: 'opensearch_sns_role_policy'
281+
PolicyDocument:
282+
Version: "2012-10-17"
283+
Statement:
284+
- Effect: Allow
285+
Action:
286+
- sns:Publish
287+
Resource:<% notifications.filter((n) => n.configType == 'sns').forEach((notification) => { %>
288+
- !GetAtt <%= notification.entity %>.TopicArn<% }); -%>
265289
<% notifications.filter((n) => n.configType == 'sns').forEach((notification) => { %>
266290
<%= notification.entity %>:
267291
Type: AWS::SNS::Topic

0 commit comments

Comments
 (0)