amazon-web-servicesamazon-ec2ec2-api-tools

ec2-automate-backup error in describe volumes


I'm getting an error when trying to run ec2-automate-backup-awscli.sh. I saw https://github.com/colinbjohnson/aws-missing-tools/issues/88 which described a similar issue, but I'm using the cron-primer.sh and .aws file and still getting this error. Here's the output I'm getting.

ec2-user:~/scripts/ec2-automate-backup$ ./ec2-automate-backup-awscli.sh -v "vol-07e1a916" -c ./cron-primer.sh

A client error (InvalidVolume.NotFound) occurred when calling the DescribeVolumes operation: The volume 'vol-07e1a916' does not exist.
An error occurred when running ec2-describe-volumes. The error returned is below:
<nothing here>

But when I run aws ec2 describe-volumes, I can see the volume.

ec2-user:~/scripts/ec2-automate-backup$  aws ec2 describe-volumes
{
    "Volumes": [
        {
            "AvailabilityZone": "us-west-2a", 
            "Attachments": [
                {
                    "AttachTime": "2015-02-25T01:34:00.000Z", 
                    "InstanceId": "i-da56b1d7", 
                    "VolumeId": "vol-07e1a916", 
                    "State": "attached", 
                    "DeleteOnTermination": false, 
                    "Device": "/dev/xvda"
                }
            ], 
            "Tags": [
                {
                    "Value": "true", 
                    "Key": "Backup-Daily"
                }
            ], 
            "Encrypted": false, 
            "VolumeType": "gp2", 
            "VolumeId": "vol-07e1a916", 
            "State": "in-use", 
            "Iops": 24, 
            "SnapshotId": "snap-f518b274", 
            "CreateTime": "2015-02-25T01:34:00.281Z", 
            "Size": 8
        }
    ]
}

Solution

  • I solved this by explicitly setting the region in the command line.

    ec2-user:~/scripts/ec2-automate-backup$ ./ec2-automate-backup-awscli.sh -v "vol-07e1a916" -c ./cron-primer.sh -r "us-west-2"