Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

botocore.exceptions.ProfileNotFound when code run on AWS elastic beanstalk, but locally it's OK

I am trying to run a python application on an Elastic Beanstalk which need to have permissions for the SQS and Dynamo DB.

I have created a profile under ~/.aws/config file like this:

[profile yolo]
aws_access_key_id = some-key
aws_secret_access_key = some-secret
region = some-region

and also started the elastic beanstalk like:

eb init --profile yolo

but when I check the logs online it states:

botocore.exceptions.ProfileNotFound: The config profile (yolo) could not be found

How do I get the boto3 to know this profile on elastic beanstalk environment?

Thanks.

like image 200
nbtk Avatar asked Jul 15 '16 00:07

nbtk


2 Answers

You will also get this error if AWS_DEFAULT_PROFILE environment variable is set, but no config file is present.

like image 90
Gudlaugur Egilsson Avatar answered Nov 19 '22 08:11

Gudlaugur Egilsson


Try changing your .aws/config file header to - [yolo] instead of [profile yolo], and also separating the config and credentials to two files, as described in this link - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html This should fix your problems.

like image 30
Yaron Idan Avatar answered Nov 19 '22 09:11

Yaron Idan