AWS EC2 CLI “AWS was not able to validate the provided access credentials”
I am just trying to run my aws cli from a VM that I keep on a disk-on-key. I added the credentials several times, even creating new accounts. After a few hours of growing perturbance and desire for violence.
Be Sure to always have an NTP client running on all of your active servers. Even if you think time is not important. it IS!!!
Running simple awscli commands worked, like
aws sts get-caller-identity
aws iam list-access-keys
but the more important
aws ec2 describe instances
kept giving a horrible error.
An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials
Apparently this is caused by not installing ntp client. In my previous job going nuts about ntp was a daily occurrance, because Openstack and Openshift always refuse to work without it properly set up, usually within the private cloud. But I hadn’t yet seen AWS act in this way.
Well all you need to do is to install ntpdate
apt install ntp ntpdate -y
then it pretty much miraculously gave me my coveted list of instances.
sudo ntpdate pool.ntp.org