Installs and configures the AWS CloudWatch Agent on a host, in order to collect detailed metrics such as memory and disk usage.
Additionally, this role creates a systemd service (cloudwatch_agent.service
) which starts the
agent automatically when the host is rebooted.
The host must be able to access the CloudWatch Logs API endpoint, via open outgoing port 443 access to either the public Internet or a VPC endpoint. Additionally, the host must have an attached IAM role granting write permissions for CloudWatch Logs. The EC2 metadata service must be reachable from the host.
The agent will automatically be upgraded to the latest available version whenever this role is run.
Name | Description | Default |
---|---|---|
config_contents | Agent configuration as a nested map of string to any type. | metrics:
metrics_collected:
mem:
measurement: ["used_percent"]
disk:
resources: ["/"]
measurement: ["used_percent"] |