AWS [Amazon Web Services] provides various services under different domains. Under Compute domain, EC2 is the service provided by AWS.
What is AWS EC2?
EC2 is Elastic Compute Cloud which is one of the integral parts of the AWS ecosystem. This enables on-demand, scalable computing capacity in the AWS Cloud.
If one launches Elastic Beanstalk, he/she can see the website where the code is uploaded but will not be able to see where the code is hosted. Here comes the hero. The code is hosted in EC2 Server in the backend [data server].
A platform as a service that provides service where one can put the code and it can automatically provide a DNS name where the website is hosted, you have created.
Is EC2 a Virtual Machine?
Developers can create instances of virtual machines and easily configure the capacity scaling of instances using the EC2 web interface.
EC2 service is a virtual machine service. They provide you a server in any data center which you choose. For example, if you are in Mumbai and you want a server that is hosted in Russia Datacenter. That is what EC2 provides.
If you need a bigger server you need not buy more servers, you can simply increase the size [RAM and Storage space] and you will get a larger server that is why it is known to be flexible and capable.
For your website, you can enable auto-scaling and create multiple copies of the server. Starting with EC2 is great because EC2 is the most integral part of the ecosystem. It provides you scalable computing capacities.
How is EC2 Billed?
EC2 pricing is based on the hours and size of an instance, region, and operating system.
How to set up AWS EC2?
1) Create AMI [AMAZON MACHINE IMAGE]. It includes OS, Apps, Configurations
2) AMI is loaded to Amazon S3 [Simple Storage Service]
3) And it is registered with EC2
4) Then the user can launch Virtual Machines.
Amazon offers different instance types of EC2 for different requirements and budgets, including hourly, reserved, and spot rates.