"$v" prevents pathname expansion or globbing and field splitting
parameter expansion need to use single quoting '$v' or escaping $v
single quotes prevent shell expansion
shopts
set ...
-e errexit Abort script at first error, when a command exits with non-zero status (except in until or while loops, if-tests, list constructs)
need S3 access logging to find access denied errors
use jq and aws cli
( echo "Time,Identity ARN,Event ID,Service,Action,Error,Message";
aws cloudtrail lookup-events --start-time "2019-10-29T06:40:00Z" --end-time "2019-10-29T06:55:00Z" --query "Events[*].CloudTrailEvent" --output text \