.ebextensions/04_newrelic.config
files:
"/home/ec2-user/newrelic_license.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
nrsysmond-config --set license_key=$NEWRELIC_LICENSE_KEY
usermod -a -G docker newrelic
packages:
yum:
newrelic-sysmond: []
rpm:
newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
container_commands:
"01":
command: /home/ec2-user/newrelic_license.sh
"02":
command: grep -q -F 'hostname=$AWS_ENVIRONMENT_NAME' /etc/newrelic/nrsysmond.cfg || echo 'hostname=$AWS_ENVIRONMENT_NAME' >> /etc/newrelic/nrsysmond.cfg
"03":
command: /etc/init.d/newrelic-sysmond start