Ec 2
Ec 2
FEATURES OF EC2
▪ Virtual computing environments, known as instances
▪ Preconfigured templates for your instances, known as Amazon Machine Images
(AMIs), that package the bits you need for your server (including the operating
system and additional software)
▪ Various configurations of CPU, memory, storage, and networking capacity for your
instances, known as instance types
▪ Secure login information for your instances using key pairs (AWS stores the public
key, and you store the private key in a secure place)
▪ Storage volumes for temporary data that's deleted when you stop or terminate
your instance, known as instance store volumes
▪ Persistent storage volumes for your data using Amazon Elastic Block Store (Amazon
EBS), known as Amazon EBS volumes
▪ Multiple physical locations for your resources, such as instances and Amazon EBS
volumes, known as Regions and Availability Zones
▪ A firewall that enables you to specify the protocols, ports, and source IP ranges that
can reach your instances using security groups
▪ Static IPv4 addresses for dynamic cloud computing, known as Elastic IP addresses
▪ Metadata, known as tags, that you can create and assign to your Amazon EC2
resources
▪ Virtual networks you can create that are logically isolated from the rest of the AWS
cloud, and that you can optionally connect to your own network, known as virtual
private clouds(VPCs)
EC2 PURCHASE OPTIONS
▪ On-Demand Instances – Pay, by the second, for the instances that you launch.
▪ Reserved Instances – Purchase, at a significant discount, instances that are always
available, for a term from one to three years.
▪ Scheduled Instances – Purchase instances that are always available on the specified
recurring schedule, for a one-year term.
▪ Spot Instances – Request unused EC2 instances, which can lower 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.
RESERVED INSTANCE
▪ Term Commitment
– You can purchase a Reserved Instance for a one-year or three-year commitment, with the three-year commitment
offering a bigger discount.
– One-year: A year is defined as 31536000 seconds (365 days).
– Three-year: Three years is defined as 94608000 seconds (1095 days).
▪ Payment Options
– The following payment options are available for Reserved Instances:
– All Upfront: Full payment is made at the start of the term, with no other costs or additional hourly charges incurred for
the remainder of the term, regardless of hours used.
– Partial Upfront: A portion of the cost must be paid upfront and the remaining hours in the term are billed at a
discounted hourly rate, regardless of whether the Reserved Instance is being used.
– No Upfront: You are billed a discounted hourly rate for every hour within the term, regardless of whether the Reserved
Instance is being used. No upfront payment is required.
▪ Offering Class
– If your computing needs change, you may be able to modify or exchange your Reserved Instance, depending on the
offering class.
– Standard: These provide the most significant discount, but can only be modified.
– Convertible: These provide a lower discount than Standard Reserved Instances, but can be exchanged for another
Convertible Reserved Instance with different instance attributes. Convertible Reserved Instances can also be modified.
SCHEDULED INSTANCE
▪ A Spot Instance is an unused EC2 instance that is available for less than the On-Demand price.
▪ Because Spot Instances enable you to request unused EC2 instances at steep discounts, you
can lower your Amazon EC2 costs significantly.
▪ The hourly price for a Spot Instance is called a Spot price.
▪ The Spot price of each instance type in each Availability Zone is set by Amazon EC2, and
adjusted gradually based on the long-term supply of and demand for Spot Instances.
▪ Your Spot Instance runs whenever capacity is available and the maximum price per hour for
your request exceeds the Spot price.
▪ Spot Instances are a cost-effective choice if you can be flexible about when your applications
run and if your applications can be interrupted.
▪ For example, Spot Instances are well-suited for data analysis, batch jobs, background
processing, and optional tasks.
DEDICATED HOST
▪ MY AMIs
▪ AWS MARKET PLACE
– The AWS Marketplace is an online store where you can buy software that runs
on AWS, including AMIs that you can use to launch your EC2 instance.
– Launching an instance from a paid AMI is the same as launching an instance
from any other AMI. No additional parameters are required.
– The instance is charged according to the rates set by the owner of the AMI.
▪ COMMUNITY AMIs
EC2 INSTANCE TYPES
EC2 INSTANCE LIFE CYCLE
EBS VS INSTANCE STORE
EBS VOLUME TYPES
PLACEMENT GROUP
▪ When you launch a new EC2 instance, the EC2 service attempts to place the instance
in such a way that all of your instances are spread out across underlying hardware to
minimize correlated failures.
▪ Types:
– Cluster – packs instances close together inside an Availability Zone. This strategy enables workloads
to achieve the low-latency network performance necessary for tightly-coupled node-to-node
communication that is typical of HPC applications.
– Partition – spreads your instances across logical partitions such that groups of instances in one
partition do not share the underlying hardware with groups of instances in different partitions. This
strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra,
and Kafka.
– Spread – strictly places a small group of instances across distinct underlying hardware to reduce
correlated failures.
▪ Amazon EBS encryption is available on the instance types listed below. You can
attach both encrypted and unencrypted volumes to these instance types
simultaneously.
– General purpose: A1, M3, M4, M5, M5a, M5ad, M5d, T2, T3, and T3a
– Compute optimized: C3, C4, C5, C5d, and C5n
– Memory optimized: cr1.8xlarge, R3, R4, R5, R5a, R5ad, R5d, X1, X1e, and z1d
– Storage optimized: D2, h1.2xlarge, h1.4xlarge, I2, and I3
– Accelerated computing: F1, G2, G3, P2, and P3
– Bare metal: c5.metal, i3.metal, m5.metal, m5d.metal, r5.metal, r5d.metal, u-6tb1.metal, u-
9tb1.metal, u-12tb1.metal, and z1d.metal
▪ curl http://169.254.169.254/latest/meta-data/
▪ curl http://169.254.169.254/latest/meta-data/security-groups
▪ curl http://169.254.169.254/latest/user-data
USER DATA EXAMPLES