AWS -EC2 (Amazon Elastic Compute Cloud)
What is AWS EC2 ?
Amazon Elastic Compute Cloud, EC2 is a web service from Amazon that provides re-sizable compute services in the cloud.
On-Demand Instances – Pay, by the second, for the instances that you launch.
Reserved Instances – Reduce your Amazon EC2 costs by making a commitment to a consistent instance configuration, including instance type and Region, for a term of 1 or 3 years.
Spot Instances – Request unused EC2 instances, which can reduce your Amazon EC2 costs significantly.
Dedicated Hosts – Pay for a physical host that is fully dedicated to running your instances, and bring your existing per-socket, per-core, or per-VM software licenses to reduce costs.
Dedicated Instances – Pay, by the hour, for instances that run on single-tenant hardware.
Capacity Reservations – Reserve capacity for your EC2 instances in a specific Availability Zone for any duration.
Difference between a service and an Instance?
Let’s understand it this way:
EC2 is a service along with other Amazon Web Services like S3 etc.
When we use EC2 or any other service, we use it through an instance, e.g. t2.micro instance, in EC2 etc.
Therefore, AWS EC2 offers 5 types of instances which are as follows:
General Instances
For applications that require a balance of performance and cost.
E.g email responding systems, where you need a prompt response as well as the it should be cost effective, since it doesn’t require much processing.
Compute Instances
For applications that require a lot of processing from the CPU.
E.g analysis of data from a stream of data, like Twitter stream
Memory Instances
For applications that are heavy in nature, therefore, require a lot of RAM.
E.g when your system needs a lot of applications running in the background i.e multitasking.
Storage Instances
For applications that are huge in size or have a data set that occupies a lot of space.
E.g When your application is of huge size.
GPU Instances
For applications that require some heavy graphics rendering.
E.g 3D modelling etc.
Now, every instance type has a set of instances which are optimized for different workloads:
General Instances à t2 m4 m3
Compute Instances à c4 c3
Memory Instances à r3 x1
Storage Instances à i2 d2
GPU Instances à g2
EC2 Instance Update – C5 Instances with Local NVMe Storage (C5d)
New compute-intensive C5 instances. With a 25% to 50% improvement in price-performance over the C4 instances, the C5 instances are designed for applications like batch and log processing, distributed and or real-time analytics, ad serving, highly scalable multiplayer gaming, and video encoding
New C5d Instances with Local Storage
In order to meet this need, we are introducing C5 instances equipped with local NVMe storage. Available for immediate use in 5 regions, these instances are a great fit for the applications that I described above, as well as others that you will undoubtedly dream up! Here are the specs:
Other than the addition of local storage, the C5 and C5d share the same specs. Both are powered by 3.0 GHz Intel Xeon Platinum 8000-series processors, optimized for EC2 and with full control over C-states on the two largest sizes, giving you the ability to run two cores at up to 3.5 GHz using Intel Turbo Boost Technology.
You can use any AMI that includes drivers for the Elastic Network Adapter (ENA) and NVMe; this includes the latest Amazon Linux, Microsoft Windows (Server 2008 R2, Server 2012, Server 2012 R2 and Server 2016), Ubuntu, RHEL, SUSE, and CentOS AMIs.
EC2 Instance Update – M5 Instances with Local NVMe Storage (M5d)
5 instances equipped with local NVMe storage. Available for immediate use in 5 regions, these instances are a great fit for workloads that require a balance of compute and memory resources. Here are the specs:
The M5d instances are powered by Custom Intel® Xeon® Platinum 8175M series processors running at 2.5 GHz, including support for AVX-512.
You can use any AMI that includes drivers for the Elastic Network Adapter (ENA) and NVMe; this includes the latest Amazon Linux, Microsoft Windows (Server 2008 R2, Server 2012, Server 2012 R2 and Server 2016), Ubuntu, RHEL, SUSE, and CentOS AMIs.
Available Now
M5d instances are available in On-Demand, Reserved Instance, and Spot form in the US East (N. Virginia), US West (Oregon), Europe (Ireland), US East (Ohio), and Canada (Central) Regions. Prices vary by Region, and are just a bit higher than for the equivalent M5 instances.
Is it possible to run the multiple websites on EC2 server with one Elastic IP address?
No, it’s not possible. We need more than one elastic IP in such a case.
What are the best practices for Security in Amazon EC2?
There are several best practices to secure Amazon EC2. A few of them are given below:
Use AWS Identity and Access Management (IAM) to control access to your AWS resources.
Restrict access by only allowing trusted hosts or networks to access ports on your instance.
Review the rules in your security groups regularly, and ensure that you apply the principle of least
Privilege – only open up permissions that you require.
Disable password-based logins for instances launched from your AMI. Passwords can be found or cracked, and are a security risk.