Aws-Ec2 V1
Aws-Ec2 V1
Uses of AWS
o A small manufacturing organization uses their expertise to expand their
business by leaving their IT management to the AWS.
o A large enterprise spread across the globe can utilize the AWS to deliver the
training to the distributed workforce.
o A media company can use the AWS to provide different types of content such
as ebox or audio files to the worldwide files.
Pay-As-You-Go
Based on the concept of Pay-As-You-Go, AWS provides the services to the
customers.
AWS provides services to customers when required without any prior commitment or
upfront investment. Pay-As-You-Go enables the customers to procure services from
AWS.
o Computing
o Programming models
o Database storage
o Networking
Advantages of AWS
1) Flexibility
o We can get more time for core business tasks due to the instant availability of
new features and services in AWS.
o AWS also offers a choice that whether we want to run the applications and
services together or not. We can also choose to run a part of the IT
infrastructure in AWS and the remaining part in data centres.
2) Cost-effectiveness
3) Scalability/Elasticity
Through AWS, autoscaling and elastic load balancing techniques are automatically
scaled up or down, when demand increases or decreases respectively. AWS
techniques are ideal for handling unpredictable or very high loads. Due to this
reason, organizations enjoy the benefits of reduced cost and increased user
satisfaction.
4) Security
o AWS ensures the three aspects of security, i.e., Confidentiality, integrity, and
availability of user's data.
What is EC2?
o EC2 stands for Amazon Elastic Compute Cloud.
o Amazon EC2 is a web service that provides resizable compute capacity in the
cloud.
o Amazon EC2 reduces the time required to obtain and boot new user instances
to minutes rather than in older days, if you need a server then you had to put
a purchase order, and cabling is done to get a new server which is a very
time-consuming process. Now, Amazon has provided an EC2 which is a virtual
machine in the cloud that completely changes the industry.
o You can scale the compute capacity up and down as per the computing
requirement changes.
o Amazon EC2 changes the economics of computing by allowing you to pay only
for the resources that you actually use. Rather than you previously buy
physical servers, you would look for a server that has more CPU capacity,
RAM capacity and you buy a server over 5 year term, so you have to plan for
5 years in advance. People spend a lot of capital in such investments. EC2
allows you to pay for the capacity that you actually use.
o Amazon EC2 provides the developers with the tools to build resilient
applications that isolate themselves from some common scenarios.
o It allows you to pay a fixed rate by the hour or even by the second with no
commitment.
o On Demand is perfect for the users who want low cost and flexibility of
Amazon EC2 without any up-front investment or long-term commitment.
o On Demand instance is recommended when you are not sure which instance
type is required for your performance needs.
Reserved
o Users can make up-front payments to reduce their total computing costs. For
example, if you pay all your upfronts and you do 3 years contract, then only
you can get a maximum discount, and if you do not pay all upfronts and do
one year contract then you will not be able to get as much discount as you
can get If you do 3 year contract and pay all the upfronts.
o It provides the feature that has the capability to change the attributes of RI
as long as the exchange results in the creation of Reserved Instances of equal
or greater value.
o Like Standard Reserved Instances, it is also useful for the steady state
applications.
Scheduled Reserved Instances
o Scheduled Reserved Instances are available to launch within the specified
time window you reserve.
Spot Instances
o It allows you to bid for a price whatever price that you want for instance
capacity, and providing better savings if your applications have flexible start
and end times.
o Spot Instances are useful for those applications that have flexible start and
end times.
o It is useful for those applications that are feasible at very low compute prices.
o It is useful for those users who have an urgent need for large amounts of
additional computing capacity.
o Spot Instances are used to optimize your costs on the AWS cloud and scale
your application's throughput up to 10X.
o EC2 Spot Instances will continue to exist until you terminate these instances.
Dedicated Hosts
o A dedicated host is a physical server with EC2 instance capacity which is fully
dedicated to your use.
o The physical EC2 server is the dedicated host that can help you to reduce
costs by allowing you to use your existing server-bound software licenses. For
example, Vmware, Oracle, SQL Server depending on the licenses that you can
bring over to AWS and then they can use the Dedicated host.
o Now, we have different Amazon Machine Images. These are the snapshots of
different virtual machines. We will be using Amazon Linux AMI 2018.03.0
(HVM) as it has built-in tools such as java, python, ruby, perl, and especially
AWS command line tools.
o Choose an Instance Type, and then click on the Next. Suppose I choose a
t2.micro as an instance type.
o The main setup page of EC2 is shown below where we define setup
configuration.
Where,
Number of Instances: It defines how many EC2 instances you want to create. I
leave it as 1 as I want to create only one instance.
Purchasing Option: In the purchasing option, you need to set the price, request
from, request to, and persistent request. Right now, I leave it as unchecked.
Shutdown behavior: It defines the behavior of the instance type. You can either
stop or terminate the instance when you shut down the Linux machine. Now, I leave
it as Stop.
Monitoring: We can monitor things such as CPU utilization. Right now, I uncheck
the Monitoring.
User data: In Advanced details, you can pass the bootstrap scripts to EC2 instance.
You can tell them to download PHP, Apache, install the Apache, etc.
o Now, add the EBS volume and attach it to the EC2 instance. Root is the
default EBS volume. Click on the Next.
Volume Type: We select the Magnetic (standard) as it is the only disk which is
bootable.
In the above screen, we observe that we add two tags, i.e., the name of the server
and department. Create as many tags as you can as it reduces the overall cost.
o Configure Security Group. The security group allows some specific traffic to
access your instance.
o Review an EC2 instance that you have just configured, and then click on the
Launch button.
o Create a new key pair and enter the name of the key pair. Download the Key
pair.
o Click on the Launch Instances button.
Security Group
o A security group is a virtual firewall which is controlling the traffic to your EC2
instances.
o When you first launch an EC2 instance, you can associate it with one or more
security groups.
o Now, configure the Instance details. Keep all the details as default, and then
click on the Next.
o Attach the EBS Volume to your EC2 instance. By default, Root is the default
EBS volume which is attached to your EC2 instance. Click on the Next.
o Add tags.
o Configure Security Group. Select an existing security group that you created
previously, i.e., WebServer.
The above screen shows that a WebServer is a security group that consists of
inbound rules such as protocol, port range, and source address.
From the above screen, we observe that the security group, WebServer is open to
the world means that SSH port is open to the world.
AMI
o An AMI stands for Amazon Machine Images.
o You can also create multiple instances using single AMI when you need
instances with the same configuration.
o You can also create multiple instances using different AMI when you need
instances with a different configuration.
AMI Lifecycle
o First, you need to create and register an AMI.
o You can use an AMI to launch EC2 instances.
o When AMI is no longer required, then you can also deregister it.