From 438c3abd70377a24c089c0a319fd6ac50bed560d Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Mon, 13 Jun 2022 12:48:38 -0500 Subject: [PATCH] Fixed AWS 'teleport-generate-config' script when IMDSV2 is used --- assets/aws/files/bin/teleport-generate-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/aws/files/bin/teleport-generate-config b/assets/aws/files/bin/teleport-generate-config index a7a096876a2d6..20a6101a2d9ab 100755 --- a/assets/aws/files/bin/teleport-generate-config +++ b/assets/aws/files/bin/teleport-generate-config @@ -64,8 +64,8 @@ aws_metadata_get() { if ! is_test; then IMDS_TOKEN=$(curl -m5 -sS -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 300") - IMDS_TOKEN_HEADER="-H \"X-aws-ec2-metadata-token: ${IMDS_TOKEN}\"" - curl -m5 -sS "${IMDS_TOKEN_HEADER}" ${CURL_EXTRA_ARGS} http://169.254.169.254/latest/${REQUEST_PATH} + IMDS_TOKEN_HEADER="X-aws-ec2-metadata-token: ${IMDS_TOKEN}" + curl -m5 -sS -H "${IMDS_TOKEN_HEADER}" ${CURL_EXTRA_ARGS} http://169.254.169.254/latest/${REQUEST_PATH} else # return a pre-calculated value VARIABLE="TELEPORT_TESTVAR_${REQUEST}"