Last updated: Feb 26, 2024
Reading time·2 min
The reason the "Unable to parse config file" error occurs is that there is an error in the AWS configuration file on that machine.
In order to solve the 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 example 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.
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 as follows:
[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 will still get the error.You can learn more about the related topics by checking out the following tutorials: