amazon-web-servicesamazon-ec2aws-cliautoscalinglaunch-configuration

Updating Instance monitoring using AWS CLI


I am trying to update instance monitoring using the AWS CLI for autoscaling and using the documentation on AWS here I am trying the below command and have found no success or further documentation.

>> aws autoscaling update-auto-scaling-group --auto-scaling-group-name awseb-e-test-stack-AWSEBAutoScalingGroup-5ECR3Tc0de  --instance-monitoring Enabled=true

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
  aws help
  aws <command> help
  aws <command> <subcommand> help
Unknown options: --instance-monitoring, Enabled=true

I've also tried aws autoscaling update-auto-scaling-group --auto-scaling-group-name awseb-e-test-stack-AWSEBAutoScalingGroup-5ECR3Tc0de --instance-monitoring help but that doesn't offer any insight into the option --instance-monitoring

What would be the best way to enable detailed monitoring for instances on an existing launch configuration?


Solution

  • Unfortunately you cannot enable detailed monitoring for instances on an existing launch configuration. It is supported only in create-launch-configuration

    From Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch:

    If you have an Auto Scaling group and need to change which type of monitoring is enabled for your Auto Scaling instances, you must create a new launch configuration and update the Auto Scaling group to use this launch configuration.

    After you update the AS group with the new launch configuration:

    From now on, the instances that the Auto Scaling group launches will use the updated monitoring type. However, if you have existing instances in the Auto Scaling group, they maintain the previous monitoring type. You can terminate these instances so that Auto Scaling replaces them, or update each instance individually.