Reputation: 3145
I'm trying to run CLI commands on new beanstalk instances when they start.
The CLI commands require env vars so I've set these in my bash script:
export EC2_BASE=/opt/aws
export EC2_HOME=$EC2_BASE/apitools/ec2
export EC2_PRIVATE_KEY=$(ls $EC2_BASE/certificates/*-pk.pem)
export EC2_CERT=$(ls $EC2_BASE/certificates/*-cert.pem)
export EC2_URL=https://ec2.amazonaws.com
export PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:$EC2_HOME/bin
export JAVA_HOME=/usr
In the logs I see the certificate paths are not working and causing errors.
ls: cannot access /opt/aws/certificates/*-pk.pem: No such file or directory
What is the correct path for the certificates? I'm using the default linux ami.
The point of all this is to dynamically assign an elastic ip.
Upvotes: 0
Views: 262
Reputation: 5817
Elastic Beanstalk EC2 instances don't contain Private Key File
and X.509 Certificate
, you must upload them by yourself.
Upvotes: 1