AMI(Amazon Machine Image)

AMI(Amazon Machine Image)

AMI stands for Amazon Machine Image. Its virtual image that contains the operating system, application software, configuration settings.

AMI contains many inbuilt images like mysql, centos etc.

Steps to create default AMI :

  1. Create an ec2 machine with ubuntu server and get access with your local

  2. apt update -y

  3. apt install vfstpd -y

  4. apt install nginx -y

Create custom html file for testing

• Remove existing html file and Create custom html file

cd /var/www/html

ls

rm -rf index.nginx-debian.html

• echo “Welcome to Vaishali’s blog” > index.html

systemctl status nginx.service

• Open port 80 on ece

-Security group — edit inbound—add 80

• Take public ip of ec2 and check on browser on 80 port

Now our default AMI is created,

we can create 100s of replica instances using this as AMI with all configuration of default AMI

Steps to create custom image using AMI

  1. Click on ec2 — Actions — Image and templates— Create Image

  1. Give Image name and click on Create

  1. Check created image on Images — AMI

Q. Can you share your golden image to another user?

You, can share this custom AMI in same region with anyone

  1. Select Golden Image — Actions— Edit AMI permissions

  1. Shared accounts— Add Account Id —Share AMI

  1. Now your AMI will be shared with account ID. They can see in their AMI—images — private images

  1. They can even access nginx which we installed on default AMI.

  2. You can copy AMI from one region to another. Select AMI — copy AMI— Destination region—save

Q. How to delete Golden image?

Select AMI — Actions— Deregister AMI

Q. Can you create instance using Golden image?

Yes, you can launch many instances using golden image.