Query the instance metadata using curl and parse the output with jq tool
curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region
Example Output:
us-east-1
Query the instance metadata using curl and parse the output with jq tool
curl --silent http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region
Example Output:
us-east-1