简体   繁体   English

cloudwatch 使用 cloudformation 使用多个 SNS 主题的警报操作

[英]cloudwatch Alarm actions with multiple SNS topics usind cloudformation

HI im using below Resource using cloudformation嗨,我正在使用以下资源使用 cloudformation

"SNSTopic1":{
            "Default":"<prodteamarn>",
            "Description":"ProdteamSNStopic",
            "Type":"String"
            },

"SNSTopic2":{
            "Default":<featureteanarn>,
            "Description":"featureteamSNStopic",
            "Type":"String"
            },

    "Resources":{
            "SpilloverCountAlarm":{
                "Properties":{
                    "AlarmActions":[
                        {
                            "Ref":"SNSTopic1"
                        },
                       {
                         "Ref":"SNSTopic2"  //can i use multiple SNS topics             
                       }
                    ],
                    "AlarmDescription":"Spillover is Too Large",
                    "ComparisonOperator":"GreaterThanThreshold",
                    "Dimensions":[
                        {
                            "Name":"LoadBalancerName",
                            "Value":{
                                "Ref":"xyz"
                            }
                        }
                    ],
                    "EvaluationPeriods":"2",
                    "MetricName":"SpilloverCount",
                    "Namespace":"AWS/ELB",
                    "Period":"100",
                    "Statistic":"Sum",
                    "Threshold":"3"
                },
                "Type":"AWS::CloudWatch::Alarm"
            }

So the question is can i use multiple SNS topics in Alarmactions???所以问题是我可以在 Alarmactions 中使用多个 SNS 主题吗??? as i need to send notifications to both prod and feature teams as they have different Arn for SNS topics.因为我需要向 prod 和功能团队发送通知,因为他们对 SNS 主题有不同的 Arn。

Yes, according to the CloudFormation documentation for Alarm , the property AlarmActions is a List of actions to be performed.是的,根据 CloudFormation 的Alarm 文档,属性 AlarmActions 是要执行的操作列表。 This means you should be able to notify multiple SNS Topics without issue.这意味着您应该能够毫无问题地通知多个 SNS 主题。

You can verify this by looking at the AWS Console UI for setting up an Alarm.您可以通过查看用于设置警报的AWS 控制台 UI来验证这一点。 The section for Actions is also a List that allows for the configuration of multiple actions to be configured.动作部分也是一个列表,允许配置多个动作的配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM