Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 593
Adam Monsen Avatar asked Aug 06 '12 23:08

Adam Monsen


People also ask

How do I monitor Auto Scaling in a group?

Open the Amazon EC2 console at console.aws.amazon.com/ec2/. From the navigation pane, select Auto Scaling Groups > (select your group). From the Monitoring tab, select Auto Scaling Metrics > Enable Group Metrics Collection or Display > Auto Scaling.

Can you stop the EC2 instance which is in the Auto Scaling group?

You can terminate these instances and let Amazon EC2 Auto Scaling replace them, or use the instance refresh feature to terminate and replace the instances. Or, you can put the instances on standby, update the software, and then put the instances back in service.

How do I disable Auto Scaling group in AWS?

On the Automatic scaling tab, under Dynamic scaling policies, select the check box in the top right corner of the desired scaling policy. Scroll to the top of the Dynamic scaling policies section, and choose Actions, Disable.


1 Answers

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.

like image 174
Christopher Avatar answered Nov 15 '22 06:11

Christopher