Gist 5219363
✓ Published0🌍 Public
XXXX
Last edited Mar 22, 2013
Created on Mar 22, 2013
This shell script demonstrates how to map EC2 instances to their environment and server scope by querying the AWS instance metadata service. It uses `curl` to retrieve the instance ID and public hostname from the metadata endpoints at 169.254.169.254, then combines them with the `hostname` command and passes the result to the `ey` CLI tool via SSH. The script supports optional arguments for environment and server scope, defaulting to “stipple_prod” and “--all”, and illustrates a practical command-line workflow for infrastructure diagnostics.
AI-generated description