I am trying to set environment variables with EC2s user data, but nothing i do seems to work
here are the User data scripts i tried
#!/b
I find this to be a pretty easy way to set environment variables for all users using User Data. It allows me to configure applications so the same AMI can work with multiple scenarios:
#!/bin/bash
echo export DB_CONNECTION="some DB connection" >> /etc/profile
echo export DB_USERNAME="my user" >> /etc/profile
echo export DB_PASSWORD="my password" >> /etc/profile
Now, all users will have DB_CONNECTION, DB_USERNAME and DB_PASSWORD set as environment variables.