-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2850 from opengovsg/release-v5.29.0
build: release v5.29.0
- Loading branch information
Showing
8 changed files
with
596 additions
and
281 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# Documentation: # Reference: https://docs.datadoghq.com/integrations/amazon_elasticbeanstalk/?tab=singlecontainer#alternate-datadog-agent-configuration | ||
# Source file for datadog.yaml.example: https://github.com/DataDog/datadog-agent/blob/main/pkg/config/config_template.yaml | ||
|
||
# .ebextensions/99datadog.config | ||
option_settings: | ||
- namespace: aws:elasticbeanstalk:application:environment | ||
option_name: DD_API_KEY | ||
value: "<YOUR_DD_API_KEY>" # To set in AWS EB console only | ||
- namespace: aws:elasticbeanstalk:application:environment | ||
option_name: DD_AGENT_VERSION | ||
value: "7.31.0" | ||
- namespace: aws:elasticbeanstalk:application:environment | ||
option_name: DD_ENV | ||
value: "staging" # staging | production | ||
files: | ||
"/configure_datadog_yaml.sh": | ||
mode: "000700" | ||
owner: root | ||
group: root | ||
content: | | ||
#!/bin/bash | ||
|
||
sed -e "s/api_key:.*/api_key: ${DD_API_KEY}/" \ | ||
-e "s/# dogstatsd_non_local_traffic: false/dogstatsd_non_local_traffic: true/" \ | ||
-e "s/# hostname_file:/hostname_file:/" \ | ||
/etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml | ||
|
||
# Use the following command if you're in the EU. Replace datadoghq.eu with another region if in a different region. | ||
# sed -i 's/datadoghq.com/datadoghq.eu/' /etc/datadog-agent/datadog.yaml | ||
|
||
echo "tags:" >> /etc/datadog-agent/datadog.yaml | ||
echo " - service:formsg" >> /etc/datadog-agent/datadog.yaml | ||
echo " - env:${DD_ENV}" >> /etc/datadog-agent/datadog.yaml | ||
|
||
"/datadog/datadog.repo": | ||
mode: "000644" | ||
owner: root | ||
group: root | ||
content: | | ||
[datadog] | ||
name = Datadog, Inc. | ||
baseurl = https://yum.datadoghq.com/stable/7/x86_64/ | ||
enabled=1 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public | ||
https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public | ||
https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public | ||
|
||
"/datadog/hooks/99start_datadog.sh": | ||
mode: "000755" | ||
owner: root | ||
group: root | ||
content: | | ||
#!/bin/bash | ||
STATUS=`sudo initctl status datadog-agent` | ||
if [[ "$STATUS" == *"datadog-agent start/running"* ]] | ||
then | ||
echo "Agent already running" | ||
else | ||
echo "Agent starting..." | ||
sudo initctl start datadog-agent | ||
fi | ||
|
||
"/datadog/hooks/99stop_datadog.sh": | ||
mode: "000755" | ||
owner: root | ||
group: root | ||
content: | | ||
#!/bin/bash | ||
STATUS=`sudo initctl status datadog-agent` | ||
if [[ "$STATUS" == *"datadog-agent stop/waiting"* ]] | ||
then | ||
echo "Agent already stopped" | ||
else | ||
echo "Agent stopping..." | ||
sudo initctl stop datadog-agent | ||
fi | ||
|
||
|
||
container_commands: | ||
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: | ||
test: '[ -f /datadog/hooks/99stop_datadog.sh ]' | ||
command: "cp /datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/appdeploy/pre/" | ||
11appdeploy_post_start: | ||
test: '[ -f /datadog/hooks/99start_datadog.sh ]' | ||
command: "cp /datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/appdeploy/post/" | ||
20preinit_stop: | ||
test: '[ -f /datadog/hooks/99stop_datadog.sh ]' | ||
command: "cp /datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/preinit" | ||
21postinit_start: | ||
test: '[ -f /datadog/hooks/99start_datadog.sh ]' | ||
command: "cp /datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/postinit" | ||
30configdeploy_pre_stop: | ||
test: '[ -f /datadog/hooks/99stop_datadog.sh ]' | ||
command: "cp /datadog/hooks/99stop_datadog.sh /opt/elasticbeanstalk/hooks/configdeploy/pre/" | ||
31configdeploy_post_start: | ||
test: '[ -f /datadog/hooks/99start_datadog.sh ]' | ||
command: "cp /datadog/hooks/99start_datadog.sh /opt/elasticbeanstalk/hooks/configdeploy/post/" | ||
90install_datadog: | ||
test: '[ -f /datadog/datadog.repo ]' | ||
command: 'cp /datadog/datadog.repo /etc/yum.repos.d/datadog.repo; yum -y makecache; DD_AGENT_VERSION="$(/opt/elasticbeanstalk/bin/get-config environment -k DD_AGENT_VERSION)"; yum -y install datadog-agent${DD_AGENT_VERSION:+-$DD_AGENT_VERSION-1}' | ||
91setup_datadog: | ||
test: '[ -x /configure_datadog_yaml.sh ]' | ||
command: "/configure_datadog_yaml.sh" |
This file contains 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
This file contains 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
Oops, something went wrong.