I cannot for the life of me get serverless to respect my profile choices.
Node Version: 8.1.3
Serverless Version: 1.21.1
I have no
AWS_ environment variables set in my console.
I have a “storytape_dev” and “storytape_prod” profile setup in ~/.aws/credentials and I have removed the [default] one.
I have the region set in ~/.aws/config for both of these profiles
I have verified that the credentials work by running
aws iam list-users --profile storytape_dev and getting the user list back. I have tried it without the
--profile and it fails as expected.
What I have tried so far:
I have tried hardcoding the profile, stage, and region in my serverless.yml file.
I have followed the instructions in this guide to setup "per stage profiles"
I have removed the profile, state, and region from serverless.yml and run
AWS_PROFILE=storytape_dev sls deploy
I’m out of ideas. All of the things I’ve tried so far result in
ServerlessError: The security token included in the request is invalid.
Back before I setup multiple accounts this was working. Any help would be very much appreciated.
Here is the rub. I deactivated my production key in the AWS IAM console. When I turn on the prod key I get
The specified bucket does not exist even though I ran
AWS_PROFILE=storytape_dev sls deploy. Somehow the prod profile is being used even though I have removed all profile info from serverless.yml and set a different profile on the command line.