#!/bin/bash -eux function configure_aws_cli() { local home_dir home_dir=${1:-/root} # default to /root # Configure aws cli in case it is not yet configured mkdir -p "$home_dir/.aws" EC2_AVAIL_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) EC2_REGION=${EC2_AVAIL_ZONE::-1} cat >"$home_dir/.aws/config" <