EC2 Flashcards

1
Q

What is EC2

A

It is virtual machie in cloud, which can be provisioned quickly in minutes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the pricing Models for EC2

A

On-Demand:
Allows to pay a fixed rate by the hour without any pre-commitment

Reserved:
Capacity is reserved based on a contract with AWS, normally for 1 to 3 years

SPOT:
useful for applications with flexible start times. You can place a bid for whatever price you want for an instance price, providing even greater flexibility.

Dedicated Host:
Good for Government or legislative application, where sharing the tenancy with other applications is not allowed..
The existing software bound licences can also be used in the cloud.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain Security Groups

A

Used to allow connections to the EC2 services.When we create a security group all inbound traffic is blocked by default, we then have to manually give access to allow connections to individuals ip and port addresses.
More than one security group can be assigned to an EC2 instance.
Changes to security group take place immediately.
One security group can be attached to multiple EC2 instances and vice versa.
Security groups are stateful ie: if we create an inbound rule, then an outbound rule is automatically created.
We cannot block any ip address from Security group and it has to be done through Network access control List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is EBS?

A

Elastic block store is a virtual Hard drive in the cloud.
There are 4 types of them.
General purpose SSD : gp 2 - general purpose uses and workload transactions.Max iops voulme 16000

Provisioned iops SSD : io1: High performing ssd for special cases like Database and stuff.Max iops Volume 64000

Thoughput optimised SSD :st1 : Low cost throughput optmised ssd designed for frequently accessed throughput intensive workloads.

Cold HDD: sc1: Low-cost solution for infrequently accessed
workloads

EBS Magnetic:standard: Workloads where data is infrequently accessed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two kinds of volumes in EC2?

A

EBS backed and Instance store.
Ebs backed can be stopped and started while terminating we can ask AWS to keep the root storage Volume.
Instance store is called ephemeral storage, because we cannot start and stop, the root storage won’t be saved if we terminate it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to create an encrypted root device

A

Select the encrypted option while creating the image or

1) Create a snapshot of the unencrypted volume
2) Create a copy of the snapshot.
3) Encrypt it
4) Launch an instance from this encrypted volume

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Cloud watch?

A

Used to watch the performance of EC2 instances and other provisioned services in AWS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Cloud Trial?

A

Cloud Trial is about auditing, recording the api calls, access and basically acts like a cctv for resources.Cloud Trail is about auditing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the advantage of Roles over credentials?

A

Roles are more secure than storing credentials and easier to configure. Roles can be assigned to EC2 after it is created through command line or UI.Roles are universal and they can be used in any region

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is EFS?

A

A way to store two or more EC2 instances to store data.

The data is elastic and its great for file servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are placement groups?

A

A way to group EC2 instances based on need.

They could be Clustered, Partitioned or Spread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain different placement groups?

A

Clustered:
All EC2 instance are kept close to each other. Used for Applications with Low Network Latency and high throughput.

Spread:
These are critical individual EC2 instances located on separate racks or hardware. It’s done this way to protect the instances against network failures

Partitioned:
These are multiple EC2 instances like HDFS, HBase, and Cassandra

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Some instances of Ec2

A

A1:EC2 A1 instances are new general purpose instances powered by the AWS Graviton Processors that are custom designed by AWS, Good for webservers, microservices.
c3,c4 and C5:Compute optimised instances based on Intel Xeon Platinum processors.
F1: Instances based on FPGA, the ics can be reprogrammed to suit needs.
P2,P3, P4 : Performance optimised instances. They are good for Machine learning, deep learning kind of works.
G2, G3 : Good fpr Graphics intensive workloads like 3d modelling, games etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Two major types of EBS

A

SSD backed:SSD-backed storage for transactional workloads (performance depends primarily on IOPS)
HDD backed:For throughput workloads (performance depends primarily on throughput, measured in MB/s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to attach multiple instance to single volume?

A

It isnt allowed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is EFS?

A

It is a file system which the EC2 instance can attach to and store data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How to access EFS from Ec2?

A

Amazon EC2 instances within your VPC can access your file system directly, and Amazon EC2 Classic instances outside your VPC can mount a file system via ClassicLink.

18
Q

Uses of EFA?

A

EFA brings the scalability, flexibility, and elasticity of cloud to tightly-coupled HPC(High performance computing) applications. With EFA, tightly-coupled HPC applications have access to lower and more consistent latency and higher throughput than traditional TCP channels, enabling them to scale better.

19
Q

What is EFA?

A

Elastic Fabric Adapter (EFA) is a network interface for Amazon EC2 instances that enables customers to run applications requiring high levels of inter-node communications at scale on AWS. Its custom-built operating system (OS) bypass hardware interface enhances the performance of inter-instance communications, which is critical to scaling these applications.

20
Q

How may elastic ip addresses can be used in a region?

A

5 elastic ip addresses per region and any ip address NOT associated with an instance in charged an hourly rate.

21
Q

What is EC2 Fleet?

A

With a single API call, EC2 Fleet lets you provision compute capacity across different instance types, Availability Zones and across On-Demand, Reserved Instances (RI) and Spot Instances purchase models to help optimize scale, performance and cost

22
Q

What is Capacity reservation?

A

On-Demand Capacity Reservation is an EC2 offering that lets you create and manage reserved capacity on Amazon EC2.
You can create a Capacity Reservation by choosing an Availability Zone and quantity (number of instances) along with other instance specifications such as instance type and tenancy. Once created, the EC2 capacity is held for you regardless of whether you run the instances or not

23
Q

When to use Reserved Instances and capacity reservation?

A

Use Regional RIs for their discount benefit while committing to a one or three year term.

Use Capacity Reservations if you need the additional confidence in your ability to launch instances. Capacity Reservations can be created for any duration and can be managed independently of your RIs.

Sometimes RI discounts gets applied to Capacity Reservation

24
Q

What is Spot instance?

A

Spot Instances are spare EC2 capacity that can save you up 90% off of On-Demand prices that AWS can interrupt with a 2-minute notification.

25
Q

How is a Spot Instance different than an On-Demand instance or Reserved Instance?

A

While running, Spot Instances are exactly the same as On-Demand or Reserved instances.The instances can be interrupted by Amazon EC2 for capacity requirements with a 2-minute notification, and Spot prices adjust gradually based on long term supply and demand for spare EC2 capacity.

26
Q

What happens to a Spot instance when it gets interrupted?

A

Spot instances can be terminated, stopped or hibernated upon interruption.

27
Q

How to give permissions to applications running inside an EC2 instance to make aws api or cli requests ?

A

Use an IAM role to manage temporary credentials for applications.
To assign an AWS role to an EC2 instance and make it available to all of its applications, you create an instance profile that is attached to the instance. An instance profile contains the role and enables programs that are running on the EC2 instance to get temporary credentials.

28
Q

what is eth0 ?

A

t is the primary network interface which gets attached to every instance launched inside a VPC. The primary eth0 cannot be removed, but additional interfaces can be added.

29
Q

What happens when a secondary interface is added to an instance?

A

AWS wont assign a public ip address to eth0 in this instance.We will have to manually assign an elastic ip address.

30
Q

What happens to network interfaces, when the instances are deleted?

A

Default network interfaces are deleted when the instances are deleted, but the manually added ones arent.

31
Q

How to merge placement groups?

A

Placement groups cannot be merged.

32
Q

How many roles can be attached to an EC2 instance at a time?

A

Only one IAM role can be attached to a EC2 instance at a time.

33
Q

What are Tags in AWS?

A

Its a label we assign to an AWS resource.It is an arbitary Name/Value pair.

34
Q

What is AWS SMS?

A

Its an agent less server migration service, used to migrate workloads from Premisis to AWS.

35
Q

How to attach EBS volume to an EC2 instance in a different availability zone?

A

EBS volume need to be in the same availablity zone as the EC2 instance.

36
Q

What is the use case for Magnetic EBS?

A

When higher throughput is needed than IOPS

37
Q

How many EBS volumes and SnapShots are allowed by default?

A

5000 EBS volumes and 10000 snapshots are allowed by default.

38
Q

SnapShots of EBS volumes ?

A

EBS volumes are specific to a an AZ, but the snapshots are specific to a region.
Snapshots of non root volumes can be taken while the instance is running, encrypted and additional volumes can be created from it.
To create a snapshot of root volume, it must either be detached or the instance ust be stopped before creating a snapshot.

39
Q

Is it posible to copy AMI’s across ad within a region?

A

Yes, irrespective of the kind of volume, like Instance store or EBS the AMI can be copied and replicated across region. The volume also can be encrypted.

40
Q

What is the default monitoring duration for Ec2 instances in ASG?

A

5 minutes by default and it can be changed to 1 minute, which is chargeable

41
Q

How to add instance store volume to a running EC2 instance?

A

You can specify the instance store volumes for your instance only when you launch an instance. You can’t attach instance store volumes to an instance after you’ve launched it.