Skip to content
Merged
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
3 changes: 1 addition & 2 deletions assets/aws/files/bin/teleport-lock
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ if [ ! -f /etc/teleport.d/role.auth ]; then
fi

IMDS_TOKEN=$(curl -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}\""
NOW=$(date +%s)
TTL=$((NOW+3660))
PROCESS=$(curl -sS "${IMDS_TOKEN_HEADER}" http://169.254.169.254/latest/meta-data/local-hostname)
PROCESS=$(curl -sS -H "X-aws-ec2-metadata-token: ${IMDS_TOKEN}" http://169.254.169.254/latest/meta-data/local-hostname)
echo Locking $PROCESS for $TTL.

# Either renew the lease if agent still holds it, or grab the lease if it's expired
Expand Down