My answer here might be the help you are looking for:
https://stackoverflow.com/a/21397517/2083509
Snippet:
AWS_ACCESS_KEY="blah-blah-dingle-smith" # changeme
AWS_SECRET_KEY="yankee-doodle-shit-no-stank" # changeme
JAVA_HOME="/usr/lib/jvm/java"
EC2_HOME="/opt/aws/apitools/ec2"
EC2_URL="https://us-west-2.ec2.amazonaws.com/" # changeme
PATH="$PATH:/opt/aws/bin" # is dir contains a symlinks of tool binaries
export AWS_ACCESS_KEY AWS_SECRET_KEY JAVA_HOME EC2_HOME EC2_URL PATH
Add the above directly into your testshutdown.sh
script. Or give it its own script and load it before yours on the same crontab job. ex: * * * * * /home/ubuntu/.script/aws-env.sh; /home/ubuntu/.script/testshutdown.sh
or what i suggest todo from the link (source a *.conf) Using full access admin keys for specific tasks is never advisable. ;)
Might be wise to set your SHELL in cron itself. Replace or Add SHELL=/bin/bash
to your cron. Even if you have proper shebang, its still a good decision. You might drive yourself nuts trying to find out why commands you know work, don't.