Unfortunately, the ec2 module (neither of the AWS related modules for that
matter) doesn't allow you modify the attributes of an EC2 instance (i.e.
change its security group). I'd go as far as actually submitting this as a
feature suggestion if more agree on that.
By following the steps in the
A possible approach that I will try today is:
1. create the VPC
2. create the security groups with their custom settings within the VPC *and
a dummy one*
3. launch the WHOLE batch of EC2s at once, *in the dummy SG*
*4. have some subsequent tasks moving random EC2s (as they share exactly
the same