gpt4 book ai didi

amazon-web-services - AWS CloudFormation 错误 'Value of property AlarmActions must be of type List of String'

转载 作者:行者123 更新时间:2023-12-03 07:27:33 24 4
gpt4 key购买 nike

我正在尝试更新我的 cf 堆栈,但在部署时遇到以下错误:'AlarmActions 属性的值必须是字符串列表类型'

这是属性 AlarmActions:

 AlarmActions:
- !Ref SparksTeamSNSTopic
- !If
- CreateProdResources
- - !Ref SparksProdAlarmSNSTopic
- !ImportValue
'Fn::Sub': '${Environment}-BMCMajorAlarmTopic'
- - !Ref 'AWS::NoValue'

最佳答案

根据 AWS documentation , 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"]

关于amazon-web-services - AWS CloudFormation 错误 'Value of property AlarmActions must be of type List of String',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60995302/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com