Borislav Hadzhiev
Wed Sep 15 2021·2 min read
Photo by Taras Zaluzhnyi
The reason the "Unable to parse config file" error occurs is because there is an error in the AWS configuration file on that machine.
In order to solve the "Unable to parse config file" error we have to locate
the credentials
file and make it conform to the format the AWS CLI expects.
On linux
and macOS
, the credentials
file is located at
~/.aws/credentials
.
On windows
the file is located at C:\Users\USERNAME\.aws\credentials
.
The correct syntax for the credentials
file is as follows:
[default] aws_access_key_id=YOUR_ACCESS_KEY_ID aws_secret_access_key=YOUR_SECRET_KEY [admin] aws_access_key_id=YOUR_ACCESS_KEY_ID aws_secret_access_key=YOUR_SECRET_KEY
The snippet above sets the access key and secret access key IDs for the
default
profile and for a profile named admin
.
aws_access_key_id
or aws_secret_access_key
multiple times for the same profile.To view all of the supported settings for the credentials
file check out the
docs at
Supported config file settings.
The region
and output
format of the AWS CLI are configured in a file named
config
located in the same directory.
On linux
and macOS
, the config
file is located at ~/.aws/config
.
On windows
the config
file is located at C:\Users\USERNAME\.aws\config
.
The correct syntax for the config
file looks like:
[default] region=us-east-1 output=json [profile admin] region=us-east-1 output=json
region
or output
twice for the same profile in your config file, you would still get the "Unable to parse config file" error.