[英]CloudFormation - Using - >- expression with !Sub
Can I use - >- with?Sub?我可以使用 - >- with?Sub 吗?
Properties:
DashboardBody: !Sub
- >-
'{
... too long json ...
'}
- {something else}
Will it work?它会工作吗?
Yes, it will work.是的,它会起作用。 Here is an example:这是一个例子:
Resources:
MyDashBoard:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardBody:
!Sub
- >-
{
"widgets": [
{
"type": "metric",
"width": 12,
"height": 6,
"properties": {
"metrics": [
["AWS/EC2","CPUUtilization","AutoScalingGroupName","<your-asg-name>"]
],
"region": "${AWS::Region}",
"period": 60,
"title": "${title}"
}
}
]
}
- title: "my-dasboard-title"
DashboardName: my-dashboard-name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.