Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: InvalidProfileError - The config profile (default) could not be found despite having config file in place

I'm trying to SSH to my EB instance but

eb ssh 
eb ssh --setup

Both gives me

ERROR: InvalidProfileError - The config profile (default) could not be found

I did check $HOME/.aws/config which was generate through eb-cli and it does seem to be in the right place with correctly generated credential.

[profile eb-cli]
aws_access_key_id = correctkeyid
aws_secret_access_key = correctaccesskey

I copied config file and threw it in [project]/.aws just to see if it does anything but still the same error as expected.

like image 345
Jason Avatar asked Apr 05 '19 03:04

Jason


1 Answers

The eb ssh cli tool is attempting to read back AWS profile entries for a default AWS profile (typically from ~/.aws/config and ~/.aws/credentials files), but the profile contained in these files is a named profile – named as eb-cli, from the line [profile eb-cli].

Option 1) In the project, edit the .elasticbeanstalk/config.yml file

  • from profile: default
  • to profile: eb-cli

Option 2) Edit the bracketed names in the those ~/.aws/* files to align with the profile name declared in the config.yml file.

Or update all of these entries to something more meaningful to the project, such as my-project. Once these profile names align, you'll be able to connect with eb ssh.


Note that the ~/.aws/* configuration files support multiple named profile entries, which enables having multiple projects linked to differently named AWS profiles.

like image 184
emjayess Avatar answered Oct 05 '22 05:10

emjayess