I'm trying to use ToJsonString in Cloudformation for a Cloudwatch Dashboard. I get the following error:
{ 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"}'
}
Here is the template:
{
"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"
}
}
}
}
}
Can't find anything in the docs to assist, and I'm stuck for what to try next or if this is just not possible.