We'll continue using the vfarcic/cloud-provisioning (https://github.com/vfarcic/cloud-provisioning) repository. It contains configurations and scripts that'll help us out. You already have it cloned. To be on the safe side, we'll pull the latest version:
cd cloud-provisioning
git pull
Let's create the first EC2 instance:
docker-machine create \
--driver amazonec2 \
--amazonec2-zone ${AWS_ZONE[1]} \
--amazonec2-tags "Type,manager" \
swarm-1
We specified that the Docker Machine should use the amazonec2 driver to create an instance in the zone we defined as the environment variable AWS_ZONE_1.
We made a tag with the key type and the value manager. Tag are mostly for informational purposes.
Finally, we specified the name of the instance to be swarm-1.
The output is as follows:
Running pre-create checks...
Creating...