Serverless using AWS profiles only half working
Problem
This is a Bug Report Description When using the `serverless deploy --aws-profile` or using the `EXPORT AWS_PROFILE=<profile>; serverless deploy` or the `AWS_PROFILE=<profile> serverless deploy` it only reads from the credentials file, but that should also be reading from the config file like the default `aws cli` tools does. For example I have the following two files [code block] If I run `serverless deploy --profile dev` it will fail with [code block] Then I tried `AWS_PROFILE=dev serverless deploy` and it failed with the above error And finally I ran `export AWS_PROFILE="dev" && export AWS_REGION=us-east-1` and then ran the `serverless deploy` and the same error occur. So reading more in depth the above small link and talking to people on Gitter I moved that dev profile to `~/.aws/config`, creating new keys since the previous used a cross account mfa role. Its my experience using Troposphere and tools that rely on AWS Profiles, they should be looking into all of them and if they have an mfa, request the code about it. Additional Data Serverless Framework Version you're using: 1.15.3 Operating System: Mac OS 10.12.5 Stack Trace*: Shown above Workaround Create an additional profile and store it inside the ~/.aws/config to use and then you can refer to it using --profile <profile>
Error Output
Error: AWS provider credentials not found. You can find more info on how to set up provider credentials in our docs here: https://git.io/vXsdd
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Serverless using AWS profiles only half working
That would be awesome, but not only MFA, assuming roles between accounts as well (please? :)). As @rob-cng we have many accounts with a principal one, and it gets really hard to deploy without dirty hacks using third party tools :(
Trust Score
6 verifications
- 1
That would be awesome, but not only MFA, assuming roles between accounts as well
As @rob-cng we have many accounts with a principal one, and it gets really hard to deploy without dirty hacks using third party tools :(
Validation
Resolved in serverless/serverless GitHub issue #3833. Community reactions: 16 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep