Question:
I have two AWS accounts, one for personal, one for work-related projects. I’ve previously created and deployed to my personal AWS account.
I want to create a work-related app on the work AWS account. I signed in with those credentials, and created a new application from within the console.
Then, in my work project folder, I eb init
and eb create
/deploy
the work app. When I did eb create
, it was asking to set up a an environment different than the one I had created in AWS. After creating it, I found that a new project had be created within my personal AWS account.
I was told I have to change profiles doing eb --profile
but am not sure of my profile names. How can I list and change my profile from my personal to my work profile?
EDIT:
I was given an access key ID. I tried eb --profile MYKEYID
. No message was displayed when I did this. I’m not sure which profile I’m on.
Answer:
The EB CLI and the AWS CLI share the same credentials.
They are stored in either ~/.aws/config
or ~/.aws/credentials
.
You can list them using
1 2 |
aws configure list |
Once you know what profile you want to use, you can set it permanently for that project by running
1 2 |
eb init --profile ProfileName |
in the project directory.
You can see what settings the EB CLI has for your project by looking at the .elasticbeanstalk/config.yml
file.