Add a couple of AWS exercises
Questions as well :)
This commit is contained in:
parent
8b0360e13c
commit
f7edd72302
@ -1,14 +1,14 @@
|
|||||||
<p align="center"><img src="images/devops_exercises.png"/></p>
|
<p align="center"><img src="images/devops_exercises.png"/></p>
|
||||||
|
|
||||||
:information_source: This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE :)
|
:information_source: This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE
|
||||||
|
|
||||||
:bar_chart: There are currently **1999** questions
|
:bar_chart: There are currently **1999** exercises and questions
|
||||||
|
|
||||||
:books: To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
|
:books: To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository
|
||||||
|
|
||||||
:warning: You can use these for preparing for an interview but most of the questions and exercises don't represent an actual interview. Please read [FAQ page](faq.md) for more details
|
:warning: You can use these for preparing for an interview but most of the questions and exercises don't represent an actual interview. Please read [FAQ page](faq.md) for more details
|
||||||
|
|
||||||
:busts_in_silhouette: [Join](https://www.facebook.com/groups/538897960007080) our [DevOps community](https://www.facebook.com/groups/538897960007080) where we have discussions and share resources on DevOps
|
:busts_in_silhouette: Join our [DevOps community](https://www.facebook.com/groups/538897960007080) where we have discussions and share resources on DevOps
|
||||||
|
|
||||||
:pencil: You can add more questions and exercises by submitting pull requests :) Read about contribution guidelines [here](CONTRIBUTING.md)
|
:pencil: You can add more questions and exercises by submitting pull requests :) Read about contribution guidelines [here](CONTRIBUTING.md)
|
||||||
|
|
||||||
|
@ -18,9 +18,11 @@
|
|||||||
|--------|--------|------|----|----|
|
|--------|--------|------|----|----|
|
||||||
| Launch EC2 web instance | EC2 | [Exercise](launch_ec2_web_instance.md) | [Solution](solutions/launch_ec2_web_instance.md) | Easy |
|
| Launch EC2 web instance | EC2 | [Exercise](launch_ec2_web_instance.md) | [Solution](solutions/launch_ec2_web_instance.md) | Easy |
|
||||||
| Security Groups | EC2 | [Exercise](security_groups.md) | [Solution](solutions/security_groups.md) | Easy |
|
| Security Groups | EC2 | [Exercise](security_groups.md) | [Solution](solutions/security_groups.md) | Easy |
|
||||||
| IAM Roles | EC2 + IAM | [Exercise](ec2_iam_roles.md) | [Solution](solutions/ec2_iam_roles.md) | Easy |
|
| IAM Roles | EC2, IAM | [Exercise](ec2_iam_roles.md) | [Solution](solutions/ec2_iam_roles.md) | Easy |
|
||||||
| Spot Instances | EC2 | [Exercise](create_spot_instances.md) | [Solution](solutions/create_spot_instances.md) | Easy |
|
| Spot Instances | EC2 | [Exercise](create_spot_instances.md) | [Solution](solutions/create_spot_instances.md) | Easy |
|
||||||
|
| Elastic IP | EC2, Networking | [Exercise](elastic_ip.md) | [Solution](solutions/elastic_ip.md) | Easy |
|
||||||
|
| Placement Groups Creation | EC2, Placement Groups | [Exercise](placement_groups.md) | [Solution](solutions/placement_groups.md) | Easy |
|
||||||
|
| Elastic Network Interfaces | EC2, ENI | [Exercise](elastic_network_interfaces.md) | [Solution](solutions/elastic_network_interfaces.md) | Easy |
|
||||||
|
|
||||||
#### AWS - Lambda
|
#### AWS - Lambda
|
||||||
|
|
||||||
@ -303,6 +305,14 @@ Storage Optimized:
|
|||||||
* Use cases: databases, OLTP system, distributing file systems
|
* Use cases: databases, OLTP system, distributing file systems
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What can you attach to an EC2 instance in order to store data?</summary><br><b>
|
||||||
|
|
||||||
|
EBS
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
##### AWS EC2 - EBS
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>What is EBS?</summary><br><b>
|
<summary>What is EBS?</summary><br><b>
|
||||||
|
|
||||||
@ -310,6 +320,18 @@ Storage Optimized:
|
|||||||
More on EBS [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html)
|
More on EBS [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html)
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What happens to EC2 disk (EBS) when the instance is terminated?</summary><br><b>
|
||||||
|
|
||||||
|
All the related EBS volumes are removed and data is lost.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What happens to the EC2 disk (EBS) when the instance is stopped?</summary><br><b>
|
||||||
|
|
||||||
|
Disk is intact and can be used when the instance starts.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>What EC2 pricing models are there?</summary><br><b>
|
<summary>What EC2 pricing models are there?</summary><br><b>
|
||||||
|
|
||||||
@ -509,6 +531,24 @@ Set of Spot instance and if you want, also on-demand instances.
|
|||||||
* capacityOptimized: optimized based on the number of instances
|
* capacityOptimized: optimized based on the number of instances
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>From networking perspective, what do you get by default when running an EC2 instance?</summary><br><b>
|
||||||
|
|
||||||
|
A private IP and a public IP.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What happens when you hibernate an EC2 instance?</summary><br><b>
|
||||||
|
|
||||||
|
[AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html: "Hibernation saves the contents from the instance memory (RAM) to your Amazon Elastic Block Store (Amazon EBS) root volume."
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? Using EC2 hibernate option results in having faster instance boot</summary><br><b>
|
||||||
|
|
||||||
|
True. This is because the operating system isn't restarted or stopped.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
#### AWS - Lambda
|
#### AWS - Lambda
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -1100,8 +1140,26 @@ False. Only one internet gateway can be attached to a single VPC.
|
|||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>What is an Elastic IP address?</summary><br><b>
|
<summary>What is an Elastic IP address?</summary><br><b>
|
||||||
An Elastic IP address is a reserved public IP address that you can assign to any EC2 instance in a particular region, until you choose to release it.
|
|
||||||
When you associate an Elastic IP address with an EC2 instance, it replaces the default public IP address. If an external hostname was allocated to the instance from your launch settings, it will also replace this hostname; otherwise, it will create one for the instance. The Elastic IP address remains in place through events that normally cause the address to change, such as stopping or restarting the instance.
|
[AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html): "An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic IP address is allocated to your AWS account, and is yours until you release it. By using an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account."
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? When stopping and starting an EC2 instance, its public IP changes</summary><br><b>
|
||||||
|
|
||||||
|
True
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What are the best practices around Elastic IP?</summary><br><b>
|
||||||
|
|
||||||
|
The best practice is actually not using them in the first place. It's more common to use a load balancer without a public IP or use a random public IP and register a DNS record to it
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? An Elastic IP is free, as long it's not associated with an EC2 instance</summary><br><b>
|
||||||
|
|
||||||
|
False. An Elastic IP is free of charge as long as **it is ** associated with an EC2 instance. This instance should be running and should have only one Elastic IP.
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -1125,6 +1183,88 @@ Read more about it [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec
|
|||||||
Allows you to connect your corporate network to AWS network.
|
Allows you to connect your corporate network to AWS network.
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? When you need a fixed public IP for your instance, you should use an Elastic IP</summary><br><b>
|
||||||
|
|
||||||
|
True
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
##### AWS EC2 - ENI
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Explain Elastic Network Interfaces (ENI)</summary><br><b>
|
||||||
|
|
||||||
|
[AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html): "An elastic network interface is a logical networking component in a VPC that represents a virtual network card."
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Name at least three attributes the Elastic Network Interfaces (ENI) can include</summary><br><b>
|
||||||
|
|
||||||
|
1. One public IPv4 address
|
||||||
|
2. Mac Address
|
||||||
|
3. A primary private IPv4 address (from the address range of your VPC)
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? ENI are not bound to a specific availability zone</summary><br><b>
|
||||||
|
|
||||||
|
False. ENI are bound to specific availability zone.
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>True or False? ENI can be created independently of EC2 instances</summary><br><b>
|
||||||
|
|
||||||
|
True. They can be attached later on and on the fly (for failover purposes).
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
##### AWS EC2 - Placement Groups
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What are "Placement Groups"?</summary><br><b>
|
||||||
|
|
||||||
|
[AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html): "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."
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What Placement Groups strategies are there?</summary><br><b>
|
||||||
|
|
||||||
|
* Cluster: places instance close together in an AZ.
|
||||||
|
* Spread: spreads the instance across the hardware
|
||||||
|
* Partition: spreads the instances across different partitions (= different sets of hardware/racks) within an AZ
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>For each of the following scenarios choose a placement group strategy:
|
||||||
|
|
||||||
|
* High availability is top priority
|
||||||
|
* Low latency between instances
|
||||||
|
* Instances must be isolated from each other
|
||||||
|
* Big Data applications that are partition aware
|
||||||
|
* Big Data process that needs to end quickly</summary><br><b>
|
||||||
|
|
||||||
|
* High availability is top priority - Spread
|
||||||
|
* Low latency between instances - Cluster
|
||||||
|
* Instances must be isolated from each other - Spread
|
||||||
|
* Big Data applications that are partition aware - Partition
|
||||||
|
* Big Data process that needs to end quickly - Cluster
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What are the cons and pros of the "Cluster" placement group strategy?</summary><br><b>
|
||||||
|
|
||||||
|
Cons: if the hardware fails, all instances fail
|
||||||
|
Pros: Low latency & high throughput network
|
||||||
|
</b></details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>What are the cons and pros of the "Spread" placement group strategy?</summary><br><b>
|
||||||
|
|
||||||
|
Cons:
|
||||||
|
* Current limitation is 7 instances per AZ (per replacement group)
|
||||||
|
Pros:
|
||||||
|
* Maximized high availability (instances on different hardware, span across AZs)
|
||||||
|
</b></details>
|
||||||
|
|
||||||
#### AWS - Identify the service or tool
|
#### AWS - Identify the service or tool
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
@ -1668,4 +1808,3 @@ AWS definition: "Amazon Simple Queue Service (SQS) is a fully managed message qu
|
|||||||
|
|
||||||
Learn more about it [here](https://aws.amazon.com/sqs)
|
Learn more about it [here](https://aws.amazon.com/sqs)
|
||||||
</b></details>
|
</b></details>
|
||||||
|
|
||||||
|
10
exercises/aws/elastic_ip.md
Normal file
10
exercises/aws/elastic_ip.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## AWS EC2 - Elastic IP
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* An EC2 instance with public IP (not elastic IP)
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
1. Write down the public IP of your EC2 instance somewhere and stop & start the instance. Does the public IP address is the same? why?
|
||||||
|
2. Handle this situation so you have the same public IP even after stopping and starting the instance
|
10
exercises/aws/elastic_network_interfaces.md
Normal file
10
exercises/aws/elastic_network_interfaces.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
## AWS EC2 - Elastic Network Interfaces
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* An EC2 instance with network interface
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
A. Create a network interface and attach it to the EC2 instance that already has one network interface
|
||||||
|
B. Explain why would anyone use two network interfaces
|
6
exercises/aws/placement_groups.md
Normal file
6
exercises/aws/placement_groups.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
## AWS EC2 - Placement Groups
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
A. Create a placement group. It should be one with a low latency network. Make sure to launch an instance as part of this placement group.
|
||||||
|
B. Create another placement group. This time high availability is a priority
|
28
exercises/aws/solutions/elastic_ip.md
Normal file
28
exercises/aws/solutions/elastic_ip.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
## AWS EC2 - Elastic IP
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* An EC2 instance with public IP (not elastic IP)
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
1. Write down the public IP of your EC2 instance somewhere and stop & start the instance. Does the public IP address is the same? why?
|
||||||
|
2. Handle this situation so you have the same public IP even after stopping and starting the instance
|
||||||
|
|
||||||
|
### Solution
|
||||||
|
|
||||||
|
1. Go to EC2 service -> Instances
|
||||||
|
1. Write down current public IP address
|
||||||
|
2. Click on "Instance state" -> Stop instance -> Stop
|
||||||
|
3. Click on "Instance state" -> Start Instance
|
||||||
|
4. Yes, the public IP address has changed
|
||||||
|
2. Let's use an Elastic IP address
|
||||||
|
1. In EC2 service, under "Network & Security" click on "Elastic IP"
|
||||||
|
2. Click on the "Allocate elastic IP address" button
|
||||||
|
3. Make sure you select "Amazon's pool of IPv4 addresses" and click on "Allocate"
|
||||||
|
4. Click on "Actions" and then "Associate Elastic IP address"
|
||||||
|
1. Select "instance", choose your instance and provide its private IP address
|
||||||
|
2. Click on "Associate"
|
||||||
|
5. Now, if we go back to the instance page, we can see it is using the Elastic IP address as its public IP
|
||||||
|
|
||||||
|
Note: to remove it, use "disassociate" option and don't forget to also release it so you won't be billed.
|
25
exercises/aws/solutions/elastic_network_interfaces.md
Normal file
25
exercises/aws/solutions/elastic_network_interfaces.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
## AWS EC2 - Elastic Network Interfaces
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* An EC2 instance with network interface
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
A. Create a network interface and attach it to the EC2 instance that already has one network interface
|
||||||
|
B. Explain why would anyone use two network interfaces
|
||||||
|
|
||||||
|
### Solution
|
||||||
|
|
||||||
|
A.
|
||||||
|
1. Go to EC2 service
|
||||||
|
2. Click on "Network Interfaces" under "Network & Security"
|
||||||
|
3. Click on "Create network interface"
|
||||||
|
4. Provide a description
|
||||||
|
5. Choose a subnet (one that is in the AZ as the instance)
|
||||||
|
6. Optionally attach a security group and click on "Create network interface"
|
||||||
|
7. Click on "Actions" -> "Attach" and choose the instance to attach it to
|
||||||
|
8. If you go now to "Instances" page you'll see your instance has two network interfaces
|
||||||
|
|
||||||
|
B.
|
||||||
|
1. You can move the second network interface between instances. This allows us to create kind of a failover mechanism between the instances.
|
23
exercises/aws/solutions/placement_groups.md
Normal file
23
exercises/aws/solutions/placement_groups.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
## AWS EC2 - Placement Groups
|
||||||
|
|
||||||
|
### Objectives
|
||||||
|
|
||||||
|
A. Create a placement group. It should be one with a low latency network. Make sure to launch an instance as part of this placement group.
|
||||||
|
B. Create another placement group. This time high availability is a priority
|
||||||
|
|
||||||
|
### Solution
|
||||||
|
|
||||||
|
A.
|
||||||
|
1. Go to EC2 service
|
||||||
|
2. Click on "Placement Groups" under "Network & Security"
|
||||||
|
3. Click on "Create placement group"
|
||||||
|
4. Give it a name and choose the "Cluster" placement strategy because the requirement is low latency network
|
||||||
|
5. Click on "Create group"
|
||||||
|
6. Go to "Instances" and click on "Launch an instance". Choose any properties you would like, just make sure to check "Add instance to placement group" and choose the placement group you've created
|
||||||
|
|
||||||
|
B.
|
||||||
|
1. Go to EC2 service
|
||||||
|
2. Click on "Placement Groups" under "Network & Security"
|
||||||
|
3. Click on "Create placement group"
|
||||||
|
4. Give it a name and choose the "Spread" placement strategy because the requirement is high availability as top priority
|
||||||
|
5. Click on "Create group"
|
Loading…
Reference in New Issue
Block a user