Mock AWS services with moto_server
MotoServer.jl requires the Python package moto[server]
, which can be installed with pip
(prior to the moto[server]
extra being added, the server was available in the moto
package).
The moto_server
executable must be accessible on the PATH
(this should happen by default when it is installed).
# this runs a `moto_server` on PROXY_HOST:PROXY_PORT, serving the S3 API
ms = MockAWSServer(; host=PROXY_HOST, port=PROXY_PORT, service="s3")
# run AWS code, configuring the AWS client to point to PROXY_HOST:PROXY_PORT
# the server can be manually killed or left to be finalized,
# but it'll hold onto the port until then
kill(ms)
PROXY_HOST:PROXY_PORT
defaults to 127.0.0.1:5000
, which is also moto_server
's default.
service
defaults to ""
, and will have whatever behaviour moto_server
has when no argument is passed to it (this appears to be undefined).
11/02/2016
over 2 years ago
12 commits