Skip to content

Commit

Permalink
deployment: Missing token in metadata requests
Browse files Browse the repository at this point in the history
  • Loading branch information
cruizba committed Feb 29, 2024
1 parent aac79ef commit 78d17de
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ Resources:
WORKINGDIR=/opt/openvidu
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
ASG_DATA=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/user-data)
AWS_AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
AWS_AVAIL_ZONE=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone)
AWS_REGION="`echo \"$AWS_AVAIL_ZONE\" | sed 's/[a-z]$//'`"
AWS_INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
AWS_INSTANCE_ID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)

# S3 bucket
OPENVIDU_PRO_CONFIG_S3_BUCKET=$(echo ${ASG_DATA} | grep -Po "(OPENVIDU_PRO_CONFIG_S3_BUCKET=).+?(?=\s*(\||$))" | cut -d"=" -f2)
Expand Down

0 comments on commit 78d17de

Please sign in to comment.