Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Amplify: How to switch aws profile that amplify env is pointing to

Tags:

aws-amplify

I started the Amplify project using

amplify init

I created an environment and name it as env and chose AWS profile default. It seems like env is pointing to the default profile. Is there any way for me to make env pointing to different AWS profile?

For example, if I have two profiles:

  1. default
  2. personal

Can I make env pointing to personal AWS profile?

Thanks!

like image 397
sean0923 Avatar asked Nov 07 '22 13:11

sean0923


1 Answers

I know this question is a couple of years old, but I had a similar issue and came across it.

The relevant configuration is in <your-project>/amplify/.config/local-aws-info.json, which will look something like this:

// <your-project>/amplify/.config/local-aws-info.json
{
  "develop": {
    "configLevel": "project",
    "useProfile": true,
    "profileName": "SomeNamedProfile"
  },
  "main": {
    "configLevel": "project",
    "useProfile": true,
    "profileName": "SomeOtherNamedProfile"
  }
}

Changing the value of profileName to specify a different AWS CLI profile worked without any issues.

like image 112
d2b Avatar answered Nov 28 '22 17:11

d2b