From 78d17defa98978a41ddf42eaf043e71263c0054b Mon Sep 17 00:00:00 2001 From: cruizba Date: Thu, 29 Feb 2024 23:54:00 +0100 Subject: [PATCH] deployment: Missing token in metadata requests --- .../enterprise/aws/cfn-crete-ov-aws-asg-ami.yaml.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvidu-server/deployments/enterprise/aws/cfn-crete-ov-aws-asg-ami.yaml.template b/openvidu-server/deployments/enterprise/aws/cfn-crete-ov-aws-asg-ami.yaml.template index 8150594799..bded704cce 100644 --- a/openvidu-server/deployments/enterprise/aws/cfn-crete-ov-aws-asg-ami.yaml.template +++ b/openvidu-server/deployments/enterprise/aws/cfn-crete-ov-aws-asg-ami.yaml.template @@ -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)