Mulitple EC2 Provisioning - Do All or Do One and Make AMI?

I was wondering what is everyone’s experience with provisioning multiple EC2 instances with Ansible. I am contemplating between two methods.

Example I want to provision 10 instances. Should I

  • provisioning 10 EC2 instances, then set them up all 10 via Ansible at once. I know we can speed this up just by increasing the number of parallel job in the ansible playbook
  • OR provision 1 EC2 instance, then up that one master with Ansible. Then make an AMI copy of that EC2 instance, and then launch 9 more with that AMI instead.

Ultimately it depends how different they are from each other.

Each can be good approaches.

If you are wanting to build an image with Ansible, ec2_ami (Ansible’s module), Packer, or aminator could be useful options to look into.

A lot of folks have a base image and then will have ansible configure it the rest of the way and make sure configurations are up to date – though I always do like live configuration, because it seems useful to have the latest security updates and such.