Used to find instances that contain user data which matches the provided grep_pattern.
This was created because I needed an easy way to search all hosts for specific user data.
./search-userdata.sh "this is passed to grep"
./search-userdata.sh "-E (composer[[:space:]](.*)?install)"
Script has variables that can be hard coded to modify the behavior
ONLY_INSTANCE_IDS="" # Add instance ids to check only those; spaced.
MAX_ITEMS="" # Set max number of items, helpful for testing.
DEBUG=false # each api call and function has debugging output.
OUTPUT_NONMATCHES=false # True will output if an instance-id has a match or not.
OUTPUT_MATCHEDCONTENT=false # True will output user data for matched instances.
OUTPUT_NONMATCHEDCONTENT=false # True will output user data for non matched instances.
- jq used to parse api results cleanly
- Support Options to configure aws cli for region,profile
- Support options that are manually set as hard coded variables.