I have two very simple, one line scripts to create snapshots of drives & create an AMI of an EC2 instance. Both of these scripts work when invoked manually, however only one of them works when I run it as a scheduled task
The AMI creation script works perfectly when I invoke it via a Command line & when I run this as a scheduled task:
aws ec2 create-image --instance-id i-**************18b --name "server" --description "auto-server" --no-reboot
The EC2 Snapshot script works perfectly when invoked from the CLI tool, but won't work
as a scheduled task:
aws ec2 create-snapshot --volume-id vol-*****9e6 --description "scheduled-task-auto-server-d"
Both Scheduled Tasks are using the same Windows user
to run them and are configured identically
. (I even had two people at work verify this). They also work in the same script, meaning that if I put both lines together I get the AMI and the snapshot. However, the reason my boss doesn't want to keep them in the same script is because he wants to take weekly snapshots of EBS drives and monthly AMI's.
Why am I getting different behavior when these run? Is there anything I could do to improve these simple scripts?
Thank you for your time.