如何在CloudFormation模板中禁用自动伸缩组中实例的详细监控?

5
我正在使用CloudFormation在自动扩展组中启动一些服务器,并且我希望它们都使用基本监控。我尝试在AWS::AutoScaling::AutoScalingGroup属性以及AWS::AutoScaling::LaunchConfiguration中将Monitoring设置为false,但是堆栈无法启动;我看到CREATE_FAILED并显示错误消息:遇到不支持的属性Monitoring。
1个回答

9

在几乎但并不完全一致的CFN模板语法的温馨流氓世界中,又是一个平凡的日子。

你想要的属性是InstanceMonitoring,而不是Monitoring。它应该适用于你的LaunchConfiguration资源。更多细节请参见文档

InstanceMonitoring

Indicates whether or not instance monitoring should be enabled for this
    autoscaling group. This is enabled by default. To turn it off, set
    InstanceMonitoring to "false".

Required: No. Default value is "true".
Type: Boolean

当然,如果你要创建一个AWS::EC2::Instance资源,只需直接使用Monitoring属性即可。就我而言,相比于在VPC中移入或移出实例声明时需要将SecurityGroups更改为SecurityGroupIds,我认为这样稍微少了一点烦恼。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接