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.