amazon-web-services - AWS CloudFormation 错误“属性 AlarmActions 的值必须是字符串列表类型”
问题描述
我正在尝试更新我的 cf 堆栈并在部署时遇到以下错误:'属性 AlarmActions 的值必须是字符串列表类型'
这是属性 AlarmActions:
AlarmActions:
- !Ref SparksTeamSNSTopic
- !If
- CreateProdResources
- - !Ref SparksProdAlarmSNSTopic
- !ImportValue
'Fn::Sub': '${Environment}-BMCMajorAlarmTopic'
- - !Ref 'AWS::NoValue'
解决方案
根据 AWS文档,AlarmActions
属性必须包含值,作为字符串列表。所以如果它是JSON ,你应该有这样的东西:
"AlarmActions":[
{"Ref":"ARN of something"},
{"Ref":"ARN of something"}
]
但既然你使用过 YAML,你应该有这样的东西:
AlarmActions:
- !Split [",", !Ref SparksTeamSNSTopic] <-- make sure SparksTeamSNSTopic contains a list of strings; hence this will split it by comma
您可以定义SparksTeamSNSTopic
为
"SparksTeamSNSTopic" : ["topicarn1", "topicarn2"]
推荐阅读
- python - Python 异步 REST API,其响应依赖于 CPU 密集型计算。如何高效处理?
- android - 如何解决此 InflateException - 单击按钮后?
- compiler-errors - IAR 编译器无法识别某些变量
- ruby-on-rails - 活动存储导致 Rails 应用程序在 Heroku 上失败;在当地工作
- r - ifelse 语句在此嵌套循环中返回错误
- python - 具有相同输入大小的快速和非常慢的 scipy.signal.resample
- c# - 我想在 for loop.so 中访问 asp.net 服务器控件的“ids”,所以我可以用单行设置所有控件的值
- dictionary - 使用连接将流利的结果映射到结构
- postgresql - 加快 PostgreSQL 中名称匹配的查询
- javascript - 如何正确获取 JSON 对象来代替 [Object object]?