sam local start-api --profile option doesn't work with assumed role
See original GitHub issueMy ~/.aws/config looks like:
[profile default]
region = us-east-1
output = json
[profile admin@other]
region = us-east-1
role_arn = arn:aws:iam::123456789012:role/admin
source_profile = default
Specifying --profile admin@other
shows a warning in the logs:
2017/12/01 12:12:43 WARNING: No AWS credentials found. Missing credentials may lead to slow startup times as detailed in https://github.com/awslabs/aws-sam-local/issues/134
As a workaround I made a “dev” IAM user and access keys in the “other” account , and configured another awscli profile with those keys. Then --profile dev@other
works fine.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:12 (4 by maintainers)
Top Results From Across the Web
sam local start-api --profile option doesn't work with ... - GitHub
As a workaround I made a "dev" IAM user and access keys in the "other" account , and configured another awscli profile with...
Read more >sam local invoke - AWS Serverless Application Model
Invoke a local Lambda function using the sam local invoke command from the AWS SAM CLI.
Read more >Can one develop locally with AWS SAM using a role?
Using sam local start-api it doesn't appear to correctly take on my exported $AWS_PROFILE via ~/.aws/credentials.
Read more >AWS SAM Local Invoke with Lambda Role - Brian Pfeil
Allowing Our Lambda Role to be Assumed. In our scenario, we have a local user profile named admin stored in ~/.aws/credentials.
Read more >AWS Lambda Testing and Debugging using IntelliJ, AWS ...
To solve this error, just go to File -> Settings -> Tools -> AWS and check if the path for SAM CLI executables...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Interesting.
So, here’s my thought process so far:
Code where we initialize the session using options: https://github.com/awslabs/aws-sam-local/blob/develop/env.go#L128-L141 Godocs on session, search for:
Shared Config Fields
https://docs.aws.amazon.com/sdk-for-go/api/aws/session/Maybe since we override with our own options, the value gets set to false by default and environment variables aren’t even attempted?
Gonna fiddle with that assumption a bit more.
How to solve this issue in windows?