From 12a5317b8c1c14c7b0d46a1e5a0bcfc8bb91a204 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 28 Oct 2022 18:40:32 -0400 Subject: [PATCH] bootstrap-aws-installer: Switch to an IMDSv2-compatible URL. We don't use the token we request for anything, but a straight GET request would fail in an IMDSv2-only environment. --- tools/setup/bootstrap-aws-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup/bootstrap-aws-installer b/tools/setup/bootstrap-aws-installer index 4b141a51a8..80eb6e10e5 100644 --- a/tools/setup/bootstrap-aws-installer +++ b/tools/setup/bootstrap-aws-installer @@ -8,7 +8,7 @@ #BRANCH= #SSH_SECRET_ID= -if ! curl -fLs -m 5 http://169.254.169.254/latest/dynamic/instance-identity/document | grep instanceId; then +if ! curl -fLs -m 5 -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 10" >/dev/null; then echo "This should be run on AWS instances, not locally." exit 1 fi