Skip to content

Commit

Permalink
Merge pull request #852 from jpculp/testsys-launcher-imdsv2
Browse files Browse the repository at this point in the history
testsys-launcher: add imdsv2-only hack
  • Loading branch information
jpculp authored Aug 30, 2023
2 parents f13b7cf + 1c9eb53 commit b622cca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deploy/testsys-launcher/hack/imdsv2-only.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# The following is a convenience script that can be used to require IMDSv2

instances=$(aws ec2 describe-instances \
--filters "Name=tag-value,Values=testsys" "Name=instance-state-code,Values=16" \
--query "Reservations[*].Instances[*].[InstanceId]" \
--output text)

for instance in ${instances}; do
aws ec2 modify-instance-metadata-options \
--instance-id "${instance}" \
--http-tokens required \
--http-endpoint enabled
done

0 comments on commit b622cca

Please sign in to comment.