How do I disable detailed monitoring for instances in an auto scaling group in a CloudFormation template?

不想你离开。 提交于 2019-12-22 06:29:44

问题


I'm using CloudFormation to spin up some servers in an auto scaling group, and I want them all to use basic monitoring. I tried setting Monitoring to false in the AWS::AutoScaling::AutoScalingGroup properties as well as the AWS::AutoScaling::LaunchConfiguration, but the stack cannot start up; I see CREATE_FAILED with the error message: Encountered unsupported property Monitoring.


回答1:


Just another day in the lovingly roguish world of almost-but-not-quite-consistant CFN template syntax.

The property you want is InstanceMonitoring, not Monitoring. It should apply to your LaunchConfiguration resource. More details are in the docs.

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

Of course, if you're provisioning an AWS::EC2::Instance resource, it's just straight up Monitoring. For what it's worth, I find this slightly less annoying than changing SecurityGroups to SecurityGroupIds when moving Instance declarations in and out of VPCs, but that's just me.



来源:https://stackoverflow.com/questions/11837395/how-do-i-disable-detailed-monitoring-for-instances-in-an-auto-scaling-group-in-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!