user40097
user40097

Reputation: 41

AWS CLI: A tale of 2 date returns

I'm writing a script to help purchase a spot instance. I have created a script that works on my mac via terminal, but not on my Linux VM. Here is the script:

aws ec2 describe-spot-price-history --instance-types g2.2xlarge --product-descriptions "Windows" --start-time `date +%s`

As best I can tell, in both environments running date +%s from the command line by itself returns a similarly formatted value: 1472411661

On the Mac, I get the expected list of spot prices. (3 different prices)

On Linux, I receive Invalid value ('1472411661') for param timestamp:StartTime of type timestamp error.

On Linux, when I remove the --start-time variable, I receive a huge list of spot prices, which is what I expect based on those filters.

My setup:

Any ideas why it works in Mac Terminal but on when connected to my LinuxVM?

Upvotes: 1

Views: 134

Answers (1)

user40097
user40097

Reputation: 41

The answer was in the comment from Mark B above: the APT package on Linux was not the most up to date version of AWS CLI. When I installed it via PIP, it installed the latest version and it worked as expected.

Upvotes: 1

Related Questions