EC2 instances continued
- Amazon Machine Image:
- This is a blueprint that has all the details of the software configuration of the server that you are going to launch in AWS.
- AMI has details of
- Operating system
- Applications running on it
- Default Users etc.
- AMI’s also might incur hourly charges, because AWS has Market place of AMI’s with pre-installed softwares

- We have community AMI’s create by other users which generally donot have hourly costs
- We can create our own AMIs
- Some operating System AMIs like Windows might have more ec2 instance pricing
- What is AMI & How is it created

- Activity: Create an ec2 instance in the oregon region with ubuntu AMI and execute the following to install apache and php
sudo apt update sudo apt install apache2 stress -y sudo apt install php libapache2-mod-php php-mysql -y # Create a file in /var/www/html/info.php "<?php phpinfo(); ?>" echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php sudo service apache2 restart
- Now lets try to create an AMI with the above installations

- When we create AMI it is private by default i.e. AMI can be used in your account
- We can give permission to other AWS accounts to use the AMI

- We can also make our AMI public which will be the community image for all aws users in the Region.

- Lets delete the ec2 instance created by us
- Now launch the new ec2 instance with the AMI create by us

- Navigate for the info page

- AWS Will not charge for AMI but you need to pay for the storage costs of Snapshot.
- Now we can make this AMI available to other regions by copying the AMI. Copying the AMI will lead to creation of new snaphsot in the destination region and we will have a new AMI id

- Now delete the ec2 instance
- To remove the AMI, We need to deregister the AMI

- Now Delete the snapshots

