Configure multiple AWS profiles

From @jayair on Fri Oct 06 2017 22:40:10 GMT+0000 (UTC)

Link to chapter - https://serverless-stack.com/chapters/configure-multiple-aws-profiles.html

Copied from original issue: https://github.com/AnomalyInnovations/serverless-stack-com/issues/150

For Windows, you can set enviroment variables temporarily in your cmd or powershell session like this:

cmd

SET AWS_PROFILE=myProfile

Powershell

Set-Item -Path Env:AWS_PROFILE -Value myProfile

If you wish to permanently set the environment variable, you can use the following command in either cmd or powershell. You’ll have to close and reopen a new session to use it.

setx AWS_PROFILE "myProfile"

I am not aware of a way to set the environment variable to use for only one command. If anyone knows a way, let me know.

1 Like

Thank you for sharing!