AWS Classroom Series – 12/Oct/2021

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 Preview
    • 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 Preview
    • 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
    
    Preview
    • Now lets try to create an AMI with the above installations Preview Preview Preview Preview
    • 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 Preview
    • We can also make our AMI public which will be the community image for all aws users in the Region. Preview
    • Lets delete the ec2 instance created by us
    • Now launch the new ec2 instance with the AMI create by us Preview Preview
    • Navigate for the info page Preview
    • 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 Preview Preview
    • Now delete the ec2 instance
    • To remove the AMI, We need to deregister the AMI Preview
    • Now Delete the snapshots Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Widget by Acurax Small Business Website Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube