You can't install an Operating System on EC2. EC2 boxes are virtual boxes with custom settings and software needed to operate as part of the Amazon Cloud.
For example, if you installed a new operating system on an EC2 box, how would you get access to it? What would its IP Address be? How would it know how to communicate with the Management Studio API Servers: report its status, respond to remote reboot/terminate requests. It would no longer be a part of EC2.
You'll have to upload the software and install it onto an existing EC2 OS rather than installing a new OS. There is a fair amount of support online for doing this for Asterix PBX: