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.
This commit is contained in:
Alex Vandiver 2022-10-28 18:40:32 -04:00 committed by Tim Abbott
parent 721a1d7a10
commit 12a5317b8c
1 changed files with 1 additions and 1 deletions

View File

@ -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