credentials mocking
See original GitHub issueThis is either a question or a request.
I’ve been unable to find any references to credentials profiles in the code, so I’m guessing these aren’t implemented yet.
I’m using different profiles for different groups, and I need to make my s3 connection using profile (i.e., aws_session = boto3.Session(profile_name=profile_name)
moto does not appear to mock the profile name; it must exist in the developers ~/.aws/credentials
(or config).
Any chance this can be implemented and that other folks need it?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
why mock is failing and asking for aws credential to run locally?
I am using below code for running test cases locally, but it is asking for aws credentials which I not supposed to give....
Read more >Using AWS Mock Credentials for your unit tests in Travis
This allows you to run mock credentials for key AWS functionalities, let's see how we can set this up in Travis.
Read more >Advanced workflows - Mocking and testing - AWS Amplify Docs
Learn how to quickly test and debug without pushing all changes in your Amplify project to the cloud. Use local mocking and testing...
Read more >How To Mock AWS Services in Python Unit Tests
We're going to explore the moto library to mock AWS resources. ... Here, we're going to define fixtures to configure S3 mocking and...
Read more >Running a Test as a User in Spring MVC Test
@Test @WithMockUser(roles = ["ADMIN"]) fun requestProtectedUrlWithUser() { mvc .get("/") // ... } Copied! Security RequestPostProcessors Mocking CSRF.
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 FreeTop 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
Top GitHub Comments
I think I’ve come across this same issue and have a relatively easy way to reproduce it. Essentially, if the AWS_PROFILE environment variable is set but the profile isn’t found in ~/.aws/config, it raises an exception on import:
If I
unset AWS_PROFILE
, it’s totally fine with there being no ~/.aws/config at all. Since it’s fine if config doesn’t exist, it makes me think that it should tolerate a specific profile not being there.I suspect I’m witnessing a related, but different, issue. When I run the tests locally everything is fine (and I have the AWS credentials in
~/.aws
). Once I try to run the tests within a docker container (which doesn’t contain the credentials) I get the following error:This is thrown right after appearances of:
If, when I start the container, I mount my credentials the tests all pass. Furthermore, creating a dummy
~/.aws/credentials
with the values:is enough and the tests passes.
NB: I’m not sure if it is related, but I have update some dependencies:
This might be related.