Courtney White
Courtney White

Reputation: 614

Unified Cloudwatch Agent with Auto Scaling EC2 Instances

I want to collect php logs from my application sitting on EC2 Linux 2 instances. I've been reading the AWS docs on the Unified Cloudwatch Agent, which does exactly what I want by collecting metrics/logs and sending them to Cloudwatch.

However, after reading through the docs, I don't see anything in regards to Auto Scaling EC2 instances? I want to be able to capture logs from all EC2 instances that come and go.

How do I setup the Unified Cloudwatch Agent with Auto scaling EC2 instances? From what I've been reading it all seems to be just installing it on a single EC2 instance!

Upvotes: 2

Views: 1078

Answers (1)

Marcin
Marcin

Reputation: 238727

How do I setup the Unified Cloudwatch Agent with Auto scaling EC2 instances?

You have to set it up using your UserData. The exact details depends on AMI type (windows, linux, mac), is it standard AMI or custom AMI.

But the general idea is that you can install it using UserData, create its Agent configuration files in user data and start it. This ensures that any new instance in ASG will have the agent running and configured.

Some of these steps could be performed on pre-backed AMI, so that you do little to no setup in UserData.

Upvotes: 2

Related Questions