Ref: https://learn.cantrill.io/courses/1820301/lectures/41301604

DEMO: https://learn.cantrill.io/courses/1820301/lectures/41301605 and https://learn.cantrill.io/courses/1820301/lectures/41301606


CloudWatch Logs for EC2

Diagram: https://github.com/acantril/aws-sa-associate-saac03/blob/main/1100-ADVANCED_EC2/00_LEARNINGAIDS/LoggingonEC2CWAgent.png


DEMO: CW Agent configuration steps for A4L Wordpress instance

Ref: https://learn.cantrill.io/courses/1820301/lectures/41301605 and https://learn.cantrill.io/courses/1820301/lectures/41301606

  1. Configure IAM role that grants required permissions
  2. Install CW Agent inside the instance: sudo dnf install amazon-cloudwatch-agent
  3. Run the configuration wizard of CW Agent:
  4. Store configuration
  5. 💡 CW Agent requires this directory and this file to exist in order to start, need to manually add them since they're not there by default in Linux instances:
    1. sudo mkdir -p /usr/share/collectd/
    2. sudo touch /usr/share/collectd/types.db