Skip to content

Associate instances

Terminal window
aws ec2 associate-application-status-check \
--application-status-check-id "$ASC_ID" \
--instance-ids "$INSTANCE_ID"

Associate and disassociate calls return per-instance success and failure. If a check is already associated, that instance appears in the unsuccessful list with a reason.

Lab from Create VPC and EC2:

Terminal window
aws ec2 associate-application-status-check \
--application-status-check-id "$ASC_ID" \
--target-tag-associations Key=asc-lab,Value=true

Production-style example:

Terminal window
aws ec2 associate-application-status-check \
--application-status-check-id asc-0123456789abcdef0 \
--target-tag-associations Key=Environment,Value=production

Tag associations are rules. Each rule counts as one association toward quotas, regardless of how many instances currently match.

Amazon EC2 Auto Scaling stamps every instance with aws:autoscaling:groupName. Associate once; new launches pick up the check.

Terminal window
aws ec2 associate-application-status-check \
--application-status-check-id asc-0123456789abcdef0 \
--target-tag-associations Key=aws:autoscaling:groupName,Value=my-asg

No launch template change is required.

By instance ID:

Terminal window
aws ec2 disassociate-application-status-check \
--application-status-check-id asc-0123456789abcdef0 \
--instance-ids i-0123456789abcdef0

If you associated by tag, remove the tag from the instance (or disassociate the tag rule). After disassociation, overall status is not-applicable.

Verify in the console and CLI before you include the check in aggregation. With excluded, the instance Status and alarms card shows Application status as None associated or included.