Creates and deploys a mock JSON based microservice into Amazon (a WireMock server), configured with mock request/response pairs from a git repo of your choice. The server will automatically check for changes on that repo every minute, and will reload itself whenever a new commit is detected.
For example, suppose you have a repo like https://github.com/mindlapse/redesigned-pancake.git with a /mappings
folder containing JSON files with request/response pairs that you want to mock (see it for an example or here for more info).
You can deploy an instance that serves those mock responses into Amazon by following the steps below:
-
You have an Amazon AWS user account with an access key, secret access key, and SSH .pem file for that user.
-
Vagrant is installed: https://www.vagrantup.com/downloads.html
-
The project is cloned:
git clone https://github.com/mindlapse/deploy-mock-microservice-to-aws.git -
The
terraform.tffile in the root of the project is configured with a user's Amazon access keys and SSH keys, with the location of the Git repo containing your request/response samples for the WireMock server, and with your preferred EC2 instance size.
Open a console, and from the project folder issue the following command to deploy the mock server:
vagrant upThe mock server should be live in about 10-15 minutes, and will end with a health check showing the IP address of your new server.
To take down the environment, run this from the checkout folder:
vagrant ssh
cd /vagrant
terraform destroyIf you need support, please open a ticket and I'll respond as soon as possible.