-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-Account support - IAM Client #6284
Comments
Hi @coraliz, that's a bug indeed - thanks for raising this. To give some context: when starting a mock, Moto will delete all existing data. This ensures that there is no data leakage from previous tests. In this test, that means that the following happens:
At the end, when One workaround would be to start the IAM mock as part of the
That means that the
|
Hi @coraliz, this should be fixed in the upcoming v5 release. We've just released an alpha version to gather some early feedback, Note that there are breaking changes in this release: all service-specific decorators have been replaced with a single |
Moto V5 has now been released with a fix for this bug, so I'll close this. Release: https://pypi.org/project/moto/5.0.0/ |
Hi,
Moto 4.1.8 (installed it through poetry).
I'm trying to run a test with multi account support.
I assume a mocked role from the account i want to use. When using only RDS & EC2 Clients the resources created are using the assumed role's account ID. When adding an IAM client which is using the same session, RDS, EC2 & IAM clients go back to default account.
Attaching sample code
when I call the test this way I get the correct account id inside the ARN :
BUT when I call it with the mocked iam client, unfortunately, the account id changes. (Notice just calling the
moto_iam
fixture not even using it.)->'arn:aws:iam::123456789012:role/my-role-ScannerRole-' != 'arn:aws:iam::1111111111:role/my-role-ScannerRole-'
Thanks in advance
Coral
The text was updated successfully, but these errors were encountered: