Skip to content

Commit

Permalink
Front: use IMDSv2 to retrieve the instance ip (#2146)
Browse files Browse the repository at this point in the history
This is used by the built-in AWS Beanstalk package.
  • Loading branch information
pm47 authored Jan 25, 2022
1 parent 8758d50 commit 75ef66e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eclair-front/modules/awseb/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export LOCAL_IP=$(curl -s 169.254.169.254/latest/meta-data/local-ipv4)
# see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
TOKEN_IMDSV2=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
export LOCAL_IP=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN_IMDSV2" http://169.254.169.254/latest/meta-data/local-ipv4)
export HOSTNAME=$(hostname)

# make the eclair home directory
Expand Down

0 comments on commit 75ef66e

Please sign in to comment.