0

Is it practically possible to simulate AWS environment locally using Moto and Python? I want to write a aws gluejob that will fetch record from my local database and will upload to S3 bucket for data quality check and later trigger a lambda function for cronjob run using Moto Library using moto.lock_glue decorator.Any suggestion or document would be highly appreciated as I don't see much clue on same.Thank you in advance.

1 Answers1

1

AFAIK, moto is meant to patch boto modules for testing. I have experience working with LocalStack, a docker you can run locally, and it acts as a live service emulator for most AWS services (some are only available for paying users).

https://docs.localstack.cloud/getting-started/

You can see here which services are supported by the free version. https://docs.localstack.cloud/user-guide/aws/feature-coverage/

in order to use it, you need to change the endpoint-url to point to the local service running on docker. As it's a docker, you can incorporate it with remote tests as well e.g., if you're using k8s or a similar orchestrator

Maurice
  • 11,482
  • 2
  • 25
  • 45
Meny Issakov
  • 1,400
  • 1
  • 14
  • 30
  • 1
    Moto maintainer here: Moto does more than `patching boto modules`, but it is indeed not suitable for this use-case. We mock the Glue-service, meaning we will return the same response that AWS would return - but without executing the provided scripts. – Bert Blommers Jan 17 '23 at 11:26