AWS

nicolaw 28th November 2018 at 3:42pm
Cloud jq

AWS Certified Solutions Architect - Associate

is_emr_master () {
  [[ "$(jq -r .isMaster /var/lib/info/instance.json)" == "true" ]]
}

aws_user_data () {
  curl -sSL "http://169.254.169.254/latest/user-data/$*"
}

aws_meta_data () {
  curl -sSL "http://169.254.169.254/latest/meta-data/$*"
}

aws_region () {
  declare az=""; az="$(aws_meta_data placement/availability-zone)"
  echo "${az%[a-z]}"
}

Related