WSL – An error occurred (RequestExpired) when calling the DescribeInstances operation: Request has expired

I am using WSL with Ubuntu to connect to AWS through my Windows machine. I can connect without issue from Windows machine.
I have used the following solution to pass credentials to Linux:
How to access aws config file from WSL (Windows subsystem for Linux)?

export AWS_SHARED_CREDENTIALS_FILE=/mnt/c/Users/username/.aws/credentials

export AWS_CONFIG_FILE=/mnt/c/Users/username/.aws/config

Each time I run aws ec2 describe-instances

I get the following error:
An error occurred (RequestExpired) when calling the DescribeInstances operation: Request has expired.

I am passing aws_session_token in the credential file.

I have confirmed the time is correct and restarted WSL services

Source: Windows Questions

LEAVE A COMMENT