class: center, middle # Bash-my-AWS ## Mike Bailey - mike@bailey.net.au ## linux.conf.au 2020 | Gold Coast, Australia ??? Notes for the _first_ slide! --- class: center, middle # Agenda 1. Command Line vs. ClickOps 2. Amazon Web Services 3. Bash-my-AWS: Test Drive 4. Bash-my-AWS: Under the Hood --- class: center, middle # Command Line --- class: center, middle # ClickOps --- class: center, middle # AWS --- class: center, middle # AWS ## CloudFormation: Config as Code --- class: center, middle # AWS ![elb-asg-instances](assets/elb-asg-ec2.png) ### Load Balancer, AutoScaling Group, EC2 Instances --- class: center, middle # AWS ### `aws cloudformation list-stacks` --- class: center, middle # Bash-my-AWS --- class: center, middle # Bash-my-AWS - Resource List --- class: center, middle # Bash-my-AWS - Resource List - Resource Detail --- class: center, middle # Bash-my-AWS - Resource List - Resource Detail - Resource Action --- class: center, middle # Bash-my-AWS - Resource List - Resource Detail - Resource Action - Related Resources --- class: center, middle # Bash-my-AWS ### Demo time --- class: middle # Bash-my-AWS ### pipe-skimming ```shell instance-asgs() { local instance_ids=$(skim-stdin "$@") ... ``` ```shell skim-stdin() { ( printf -- "$*" # Print all args printf " " # Print a space [[ -t 0 ]] || awk 'ORS=" " { print $1 }' # Print first token of each line of STDIN ) | awk '{$1=$1;print}' # Trim leading/trailing spaces } ``` --- class: center, middle # Bash-my-AWS ### Documentation: bash-my-aws.org ### Source: github.com/bash-my-aws/bash-my-aws