Creating an AMI
- Create a ubuntu linux server
- Execute the following commands
sudo apt update
sudo apt install apache2 -y
sudo apt install php libapache2-mod-php php-mysql -y
echo '<?php phpinfo(); ?>' | sudo tee /var/www/html/info.php
sudo systemctl restart apache2
- Now navigate to
http://<publicip>
- Now navigate to
http://<publicip>/info.php
- We would like to increase or decrease number of ec2 instances based on metrics
- For this exercise, lets assume that the metric will be cpu utilization.
- Now for our lab purposes, we will be installing a tool which increases the load on cpu which is called as stress
- Now lets create an AMI
- Now lets create an ec2 instane with the AMI
lamp
- Now if we want this image to be availble in other regions as well
- AMI is backup of your EBS volume i.e. Snapshot + additional information (metadata)
- Pricing of AMI = Pricing of EBS Snapshots
- To remove the AMI, Use De-register AMI
- Exercise: Create an AMI for Jenkins which is installed.