I'm deploying an Elastic Beanstalk app on Amazon Linux 2023. I'm trying to configure the new Amazon CloudWatch Agent to forward custom logs to cloudwatch. This used to be done by adding some config files into an awslogs
directory, but that has been deprecated for the new agent. This new agent has a config file at /opt/amazon/amazon-cloudwatch-agent/etc/beanstalk.json
. I can see the eb-engine starting the agent with this config file so I figured I can just overwrite with my config. I have confirmed that I'm writing to the file but then it's overwritten with the defaults again before the agent is started. I'm guessing Elastic Beanstalk's scripts add in their default config just before starting the agent
How do I do this with the new agent with Elastic Beanstalk extension configs or platform hooks?
Config file below uses custom config file of new amazon-cloudwatch-agent