Skip to content

Instantly share code, notes, and snippets.

@johnh
Last active March 1, 2016 22:10
Show Gist options
  • Save johnh/a7dedfae54f61f8295ea to your computer and use it in GitHub Desktop.
Save johnh/a7dedfae54f61f8295ea to your computer and use it in GitHub Desktop.
LogEntries Elastic Beanstalk configuration using an environment variable
files:
"/home/ec2-user/setup.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
echo "\$template LogentriesFormat,\"${PS_LOGENTRIES_TOKEN} %HOSTNAME% %syslogtag%%msg%\n\"" > /etc/rsyslog.d/logger.conf
echo '*.* @@data.logentries.com:80;LogentriesFormat' >> /etc/rsyslog.d/logger.conf
service rsyslog restart
container_commands:
set_up:
command: /home/ec2-user/setup.sh
@johnh
Copy link
Author

johnh commented Mar 1, 2016

An improvement on the documentation from LogEntries here that escapes the quotes and allows the use of environment variables, for those that do not want to keep keys in their source code.

The ONLY way, it seems, to use environment variables in an .ebextension is to have it create a script and then run it from a container_command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment