I recently had to work on with one AWS service and to follow it’s getting started tutorial they invited me to use the CLI command-line interface which would configure a service for me. The CLI tool failed to configure the service itself and it did actually clear the existing ~/.aws/credentials file for me 🙁 which is very strange. To be able to continue to use AWS services I had to create the ~/.aws/credentials and the ~/.aws/config files manually.
Create ~/.aws/credentials File
sudo vi ~/.aws/credentials
Once the new file is created, provide your AWS credentials in there. For example:
[default] aws_access_key_id=AKIAIOSFODNN7EXAMPLE aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Create ~/.aws/config File
sudo vi ~/.aws/config
Once the new file is created, provide AWS profile details. For example:
[default] region=us-east-1 output=json
Hope it will help someone.