Created
April 24, 2014 02:20
-
-
Save davecap/11239288 to your computer and use it in GitHub Desktop.
.ebextensions/99datadog.config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .ebextensions/99datadog.config | |
container_commands: | |
01chmod: | |
command: "chmod +x .ebextensions/datadog/hooks/*" | |
02mkdir_appdeploy_post: | |
test: '[ ! -d /opt/elasticbeanstalk/hooks/appdeploy/post ]' | |
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post" | |
02mkdir_configdeploy_post: | |
test: '[ ! -d /opt/elasticbeanstalk/hooks/configdeploy/post ]' | |
command: "mkdir /opt/elasticbeanstalk/hooks/configdeploy/post" | |
10appdeploy_pre_stop: | |
command: "cp .ebextensions/datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/appdeploy/pre/" | |
11appdeploy_post_start: | |
command: "cp .ebextensions/datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/appdeploy/post/" | |
20preinit_stop: | |
command: "cp .ebextensions/datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/preinit" | |
21postinit_start: | |
command: "cp .ebextensions/datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/postinit" | |
30configdeploy_pre_stop: | |
command: "cp .ebextensions/datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/configdeploy/pre/" | |
31configdeploy_post_start: | |
command: "cp .ebextensions/datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/configdeploy/post/" | |
90install_datadog: | |
command: "cp .ebextensions/datadog/datadog.repo /etc/yum.repos.d/datadog.repo; yum -y makecache; yum -y install datadog-agent; /etc/init.d/datadog-agent stop" | |
91setup_datadog: | |
test: '[ ! -e /etc/dd-agent/datadog.conf ]' | |
command: "sh -c \"sed 's/api_key:.*/api_key: YOUR_API_KEY/' /etc/dd-agent/datadog.conf.example > /etc/dd-agent/datadog.conf\"" |
Nevermind. I found that EB will run the commands in ebextensions based on aplhabetical order.
"You can have multiple configuration files in your .ebextensions directory. These files are executed in alphabetical order." --AWS DOCS
Have you updated this script for the new EC2 Instance version. The one I'm battling changes to the EB deploy hooks under the "64bit Amazon Linux 2014.09 v1.2.0 running PHP 5.5" environment.
Thanks for this.
Do I actually put in the YOUR_API_KEY in this file please?
Thanks
Wow, it's 2016 and your post still works exactly as described. Thanks!
This works pretty well! I changed the last section to
91setup_datadog:
command: "sh -c \"sed 's/api_key:.*/api_key: {{DATADOG_API_KEY}}/; s/\\# tags:.*/tags: {{ENVIRONMENT}}/' /etc/dd-agent/datadog.conf.example > /etc/dd-agent/datadog.conf\""
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a reason for the 99? Just curious.