Deploying Configuration .json to Instance
To deploy this configuration file and make the Cloudwatch Agent read it which we installed via Ansible by this post, you need to be sure that you installed Cloudwatch Agent to your instance properly. After installing the agent, you need to put this configuration file under /opt/aws/amazon-cloudwatch-agent/etc directory and make sure you name it amazon-cloudwatch-agent.json.
When you start the agent after putting your configuration file, Cloudwatch service will automatically turn it into a .toml file under the same directory and reads that file.
If your agent refuse to start when you run this:
Make sure you don’t have any syntax errors in metric configuration or common-config.toml where you put your proxies.