-
-
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
Moto V5 release 🚀 - Breaking Changes ⚠️ #7198
Labels
Milestone
Comments
This was referenced Jan 7, 2024
This was referenced Jan 14, 2024
37 tasks
Moto V5 is now out. See the documentation here: |
jmsanders
added a commit
to dagster-io/dagster
that referenced
this issue
Jan 29, 2024
Moto 5 changes its public API away from individual service mocks and toward a generalized `mock_aws` decorator/context manager. getmoto/moto#7198
@bblommers Is Moto V5 backward compatible, Can we still use service-specfic decorators for existing tests? |
@archinksagar No, all service-specific decorators have been removed. The functionality carries over for 99% of usecases though, so a simple find-replace within your tests ( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello all!
We have just released Moto v5, containing a number of breaking changes.
New decorator
All service-specific decorators have been replaced with single decorator.
Having a single decorator simplifies the usage of Moto, fixes a whole class of bugs surrounding state management, and will make it easier for us to add additional features in the future.
Were you using the
mock_batch_simple
ormock_lambda_simple
decorator? These can be replaced with a newconfig
-parameter:Passthrough AWS requests
You can also configure Moto to let some requests through to AWS. By default everything will still be mocked, except for requests that match a URL configured here, or that are part of a service listed here.
Note the
mock_credentials
part. Moto explicitly mocks AWS credentials, to ensure that we're not accidentally reaching out to AWS. This safeguard has to be disabled for this feature to work, as you will getInvalidCredentials
exceptions if the credentials are still mocked.IAM Managed Policies
Moto no longer loads AWS Managed Policies by default. They will only be created if explicitly configured to do so:
@mock_aws(config={"iam": {"load_aws_managed_policies": True}})
Or by setting an environment variable:
MOTO_IAM_LOAD_MANAGED_POLICIES=true
MotoServer
When starting the MotoServer, the
service
-argument (i.e.:moto_server s3
) is no longer supported. It is recommended to use a single MotoServer instance, instead of a specific instance per AWS service.We've just released 5.0.0 with these changes. Please try it out, and raise any issues that you find.
The documentation for v5 can be found here: http://docs.getmoto.org/en/5.0.0/
The text was updated successfully, but these errors were encountered: