EC2 Flashcards

1
Q

Three things about EC2
_ compute capacity
AWS services _
It takes _

A
  • EC2 is a resizable compute capacity
  • AWS services use EC2 instance as a back end
  • EC2 takes minutes to launch new instances
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The 5 types of EC2 instances (intention)

A
  • General Purpose
    Web servers and code repositories, Balance of compute
  • Computer Optimized
    Scientific modeling, dedicated gaming servers and server engines, High performance processor
  • Memory Optimized
    In-memory caches, in-memory databases, real time big data analytics, Fast performance for workloads that process large data sets in memory
  • Accelerated Optimized
    Machine Learning, computational finance, seismic analysis, speech recognition, Hardware accelerators or co-processors
  • Storage Optimized
    NoSQL, In-memory or transactional databases, data warehousing, High sequential read and write access to very large data sets on local storage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
EC2 instances types
t2
- small
- medium
- large
- xlarge

What’s happen with the price and key attributes when increasing instance size?

A

EC2 instance sizes generally double in price and key attributes

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

In EC2, What is the recommended way to handle AWS credentials for instances?

A

Assign a role to the instance

You want to always avoid embedding your AWS credentials when possible

Instead of embedding your AWS credentials (Access Key and Secret) in your code so your instance has permissions to access to certain services you can attach a role to an instance via an Instance Profile

An instance profile defines “who am I?” Just like an IAM user represents a person, an instance profile represents EC2 instances. The only permissions an EC2 instance profile has is the power to assume a role. So the EC2 instance runs under the EC2 instance profile, defining “who” the instance is.

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

In EC2, Which placement group type places instances on different physical racks?

A

Spread

  • Each instance is placed on a different rack
  • Spreads can be multi-AZ
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In EC2, What are 3 types of placement group configuration?

A
  • Cluster
    (AZ > Cluster 1, Cluster 2)
  • Partition
    (AZ > Partition 1 > Cluster 1, cluster 2)
  • Spread
    (AZ > Rack 1, Rack 2)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In EC2, Which placement group type packs instances close together inside an AZ?

A

Cluster

  • Packs instances close together inside an AZ
  • Low latency
  • Cluster cannot be multi AZ

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. You can use placement groups to influence the placement of a group of interdependent instances to meet the needs of your workload. Depending on the type of workload, you can create a placement group using one of the following placement strategies:

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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

This advanced EC2 option lets you execute a script during the launch of your instance

  • As text
  • As File
A

UserData

Advanced Details, ther is a textbox where you can write your script that sets up an apache web-server

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

UserData for EC2 allows you to execute what kind of script on launch?

(command language)

A

Bash/Shell

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

UserData for EC2
After launch, which URL can you curl from an instance to view the UserData script?

http://x.x.x.x/ ??? ???

A

latest/user-data

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

EC2
Using curl on this IP address will let you view instance meta-data

What is the IP?

A

169.254.169.254

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

EC2 Metadata,
What options can you find in instance metadata?

There are dozens of options

A
  • public ipv4
  • ami-id
  • instance-type
  • mac
  • profile
  • metrics
  • hostname
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is EC2?

What are its 5 components?

A
  • It’s a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.
  • Instance types (General purpose, Accelerated…)
  • Placements Groups (Cluster, Partition and Spread)
  • Instance sizes (micro, medium, large, xlarge)
  • UserData (Scripts)
  • Instance profiles (Container for an IAM Role)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you troubleshoot the encoded authorization failure message?

What action should the Developer perform to make this error human-readable?

A

Use AWS Security Token Service (AWS STS) to decode the failure message. Then, verify that the AWS Identity and Access Management (IAM) role that ran the restore job has sufficient permissions.

aws sts decode-authorization-message –encoded-message (encoded error message) –query DecodedMessage –output text | jq ‘.’

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