I have the same problem.
The documentation (link below) states that "You can manually stop the CloudWatch agent using either AWS Systems Manager or the command line. When you stop it manually, you also prevent it from automatically starting at the system reboot."
However, after stopping it manually from the command line, contrary to what's said in the documentation, the CloudWatch agent starts up again after reboot.
So how does one make it stop permanently?
To my knowledge the aws agent is installed as a systemd service on most Linux distros. In order not start it at boot time the service has to be disabled using systemctl. E.g. systemctl disable amazon-ssm-agent.service
Thank you. I think your answer gave me a good hint about why it's not working as per the documentation.
systemctl isn't available on Amazon Linux which we run, however the amazon-cloudwatch-agent-ctl script uses systemctl to do a lot of things, including disabling the service.
Use the following commands to uninstall AWS Systems Manager Agent (SSM Agent) in Ubuntu.
sudo dpkg -r amazon-ssm-agent
sudo snap remove amazon-ssm-agent
The procedure varies depending on the host and operating system you are using. The most common are Amazon Linux 2 and Windows.
On Amazon Linux 2 (AL2),
if you installed CloudWatch agent using the yum package manager:
sudo yum -v remove amazon-cloudwatch-agent
if you downloaded and installed CloudWatch agent using rpm package manager:
sudo rpm -v --erase amazon-cloudwatch-agent
On Windows Server, search for Add or Remove Programs, under Apps & Features find Amazon CloudWatch Agent, and click Uninstall.
How do a trigger a reboot action on lightsail cloudwatch alarm state?Accepted Answerasked 5 months ago
How to monitor RAM memory usage of an EC2 Ubuntu instanceAccepted Answerasked 9 months ago
CloudWatch Agent - metrics are not reportingasked 8 months ago
Collecting Redis Metrics running on EC2 using CloudWatchasked 6 months ago
EC2 instance centos7 running on a VPC- Cannot start Amazon Cloudwatch Agent.asked 8 months ago
how do I uninstall the cloudwatch unified agent from an EC2 instance?asked 3 years ago
CloudWatch Agent ec2metadata not availableasked 2 years ago
What is difference between CloudWatch Agent and default EC2 monitoring?Accepted Answerasked 3 months ago
CloudWatch Unified Agent custom namespace not showing up on CloudWatch MetricsAccepted Answerasked a month ago
How to access metrics from CWAgent in CloudWatch console?asked 6 months ago