gpt4 book ai didi

aws-cloudformation - Cloudwatch DashboardBody InsufficientCapabilityException 中的 Cloudformation ToJSONString 错误

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

我正在尝试使用 ToJsonString在 Cloudformation 中用于 Cloudwatch 仪表板。我收到以下错误:

{ status: 400,
message:
'Error: BotoServerError: 400 Bad Request
{"Error": {
"Code":"InsufficientCapabilitiesException",
"Message":"Requires capabilities : [CAPABILITY_AUTO_EXPAND]",
"Type":"Sender"
},
"RequestId":"c740f653-8a51-4ef7-bf7b-d8e94e78ee8e"}'
}

这是模板:

{
"AWSTemplateFormatVersion": "2010-09-09",
"Transform": "AWS::LanguageExtensions",
"Description": "PES Dashboard",
"Parameters": {
"Environment": {
"Description": "The name of the environment. test or live",
"Type": "String",
"AllowedValues": [
"test",
"live"
]
}
},
"Resources": {
"HealthMonitor": {
"Type": "AWS::CloudWatch::Dashboard",
"Properties": {
"DashboardBody": {
"Fn::ToJsonString": {
"widgets": [
{
"type": "metric",
"x": 0,
"y": 0,
"width": 6,
"height": 6,
"properties": {
"metrics": [
[
"TPC/PES/Wevs",
"ResolveOrgUnit",
"Environment",
{
"Ref": "Environment"
},
{
"id": "resolved",
"label": "resolved",
"color": "#2ca02c"
}
],
[
{
"expression": "total-resolved",
"label": "unresolved",
"id": "unresolved",
"region": "eu-west-1",
"color": "#d62728"
}
],
[
"TPC/PES/Wevs",
"ResolveOrgUnit",
"Environment",
{
"Ref": "Environment"
},
{
"id": "total",
"stat": "SampleCount",
"visible": false,
"color": "#1f77b4"
}
]
],
"view": "pie",
"region": "eu-west-1",
"period": 86400,
"stat": "Sum",
"title": "Resolved OrgUnits"
}
},
{
"type": "metric",
"x": 6,
"y": 0,
"width": 6,
"height": 6,
"properties": {
"metrics": [
[
"TPC/PES/Wevs",
"ResolveHome",
"Environment",
{
"Ref": "Environment"
},
{
"id": "resolved",
"stat": "Sum",
"label": "Resolved",
"color": "#2ca02c"
}
],
[
{
"expression": "total-resolved",
"label": "unresolved",
"id": "unresolved",
"region": "eu-west-1",
"color": "#d62728",
"period": 86400
}
],
[
"TPC/PES/Wevs",
"ResolveHome",
"Environment",
{
"Ref": "Environment"
},
{
"id": "total",
"visible": false,
"color": "#1f77b4"
}
]
],
"view": "pie",
"region": "eu-west-1",
"period": 86400,
"stat": "SampleCount",
"title": "Resolved Homes"
}
}
]
}
},
"DashboardName": {
"Fn::Sub": "${Environment}-pes-dashboard"
}
}
}
}
}

在文档中找不到任何可以提供帮助的内容,我不知道下一步该尝试什么,或者这是否不可能。

最佳答案

您正在使用 AWS::LanguageExtension 转换。像这样的宏需要 CAPABILITY_AUTO_EXPAND 来更新堆栈,您可以在 documentation 中阅读它。 .

如果您从 cli 运行 UpdateStack 命令,只需将 -capability CAPABILITY_AUTO_EXPAND 添加到您的命令中。

关于aws-cloudformation - Cloudwatch DashboardBody InsufficientCapabilityException 中的 Cloudformation ToJSONString 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73810889/

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