Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ec2-metadata
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QUIET=""
function set_imds_token()
{
if [ -z "${IMDS_TOKEN}" ];then
IMDS_TOKEN=$(curl -s -f -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 900" "${METADATA_BASEURL}/${METADATA_TOKEN_PATH}")
IMDS_TOKEN=$(curl --noproxy '*' -s -f -X PUT -H "X-aws-ec2-metadata-token-ttl-seconds: 900" "${METADATA_BASEURL}/${METADATA_TOKEN_PATH}")
if [ "${?}" -gt 0 ] || [ -z "${IMDS_TOKEN}" ]; then
echo '[ERROR] Could not get IMDSv2 token. Instance Metadata might have been disabled or this is not an EC2 instance.' >&2
exit 1
Expand All @@ -65,7 +65,7 @@ function set_imds_token()
function get_meta()
{
local imds_out
imds_out=$(curl -s -q -H "X-aws-ec2-metadata-token:${IMDS_TOKEN}" -f "${METADATA_BASEURL}/${METADATA_VERSION}/${1}")
imds_out=$(curl --noproxy '*' -s -q -H "X-aws-ec2-metadata-token:${IMDS_TOKEN}" -f "${METADATA_BASEURL}/${METADATA_VERSION}/${1}")
echo -n "${imds_out}"
}

Expand Down