79090946

Date: 2024-10-15 16:45:31
Score: 0.5
Natty:
Report link

Assuming you're using the latest version of the AWS CLI, you can run the following:

#!/usr/bin/env bash

set -uefo pipefail

REGIONS=$(aws account list-regions | jq -r ".Regions[] | select(.RegionOptStatus != \"DISABLED\") | .RegionName")

for region in $REGIONS; do aws ec2 modify-instance-metadata-defaults --http-tokens required --region $region; done | cat
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: keian