Add a couple of AWS questions

This commit is contained in:
abregman 2021-12-20 22:29:27 +02:00
parent 6706171ca9
commit 64f3fc9164
7 changed files with 414 additions and 251 deletions

333
README.md
View File

@ -29,7 +29,7 @@
</tr>
<tr>
<td align="center"><a href="#programming"><img src="images/programming.png" width="75px;" height="75px;" alt="programming"/><br /><b>Programming</b></a></td>
<td align="center"><a href="exercises/software_development/README.md"><img src="images/programming.png" width="75px;" height="75px;" alt="programming"/><br /><b>Software Development</b></a></td>
<td align="center"><a href="#python"><img src="images/python.png" width="80px;" height="75px;" alt="Python"/><br /><b>Python</b></a></td>
<td align="center"><a href="#go"><img src="images/Go.png" width="75px;" height="75px;" alt="go"/><br /><b>Go</b></a></td>
<td align="center"><a href="exercises/shell/README.md"><img src="images/bash.png" width="70px;" height="75px;" alt="Bash"/><br /><b>Shell Scripting</b></a></td>
@ -38,7 +38,7 @@
</tr>
<tr>
<td align="center"><a href="exercises/cloud/README.md"><img src="images/cloud.png" width="110px;" height="75px;" alt="Cloud"/><br /><b>Cloud</b></a></td>
<td align="center"><a href="#aws"><img src="images/aws.png" width="75px;" height="75px;" alt="aws"/><br /><b>AWS</b></a></td>
<td align="center"><a href="exercises/aws/README.md"><img src="images/aws.png" width="75px;" height="75px;" alt="aws"/><br /><b>AWS</b></a></td>
<td align="center"><a href="#azure"><img src="images/azure.png" width="75px;" height="75px;" alt="azure"/><br /><b>Azure</b></a></td>
<td align="center"><a href="#gcp"><img src="images/googlecloud.png" width="80px;" height="75px;" alt="Google Cloud Platform"/><br /><b>Google Cloud Platform</b></a></td>
<td align="center"><a href="#openstack"><img src="images/openstack.png" width="75px;" height="75px;" alt="openstack"/><br /><b>OpenStack</b></a></td>
@ -828,7 +828,19 @@ The root of the filesystem. The beginning of the tree.
</b></details>
<details>
<summary>Can you create files in /proc?</summary><br><b>
<summary>What makes /proc different from other filesystems?</summary><br><b>
</b></details>
<details>
<summary>True or False? only root can create files in /proc</summary><br><b>
False. No one can create file in /proc directly (certain operations can lead to files being created in /proc by the kernel).
</b></details>
<details>
<summary>What can be found in /proc/cmdline?</summary><br><b>
The command passed to the boot loader to run the kernel
</b></details>
<details>
@ -1023,7 +1035,7 @@ tail -f <file_name>
<summary>How you measure time execution of a program?</summary><br><b>
</b></details>
#### Linux Kernel
#### Linux - Kernel
<details>
<summary>What is a kernel, and what does it do?</summary><br><b>
@ -1054,6 +1066,68 @@ The operating system executes the kernel in protected memory to prevent anyone f
Applications can access system resources and indirectly the kernel space by making what is called "system calls".
</b></details>
<details>
<summary>In what phases of kernel lifecycle, can you change its configuration?</summary><br><b>
* Build time (when it's compiled)
* Boot time (when it starts)
* Runtime (once it's already running)
</b></details>
<details>
<summary>Where can you find kernel's configuration?</summary><br><b>
Usually it will reside in `/boot/config-<kernel version>.<os release>.<arch>`
</b></details>
<details>
<summary>Where can you find the file that contains the command passed to the boot loader to run the kernel?</summary><br><b>
`/proc/cmdline`
</b></details>
<details>
<summary>How to list kernel's runtime parameters?</summary><br><b>
`sysctl -a`
</b></details>
<details>
<summary>Will running <code>sysctl -a</code> as a regular user vs. root, produce different result?</summary><br><b>
Yes, you might notice that in most systems, when running `systctl -a` with root, you'll get more runtime parameters compared to executing the same command with a regular user.
</b></details>
<details>
<summary>You would like to enable IPv4 forwarding in the kernel, how would you do it?</summary><br><b>
`sudo sysctl net.ipv4.ip_forward=1`
To make it persistent (applied after reboot for example): insert `net.ipv4.ip_forward = 1` into `/etc/sysctl.conf`
Another way to is to run `echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward`
</b></details>
<details>
<summary>How <code>sysctl</code> applies the changes to kernel's runtime parameters the moment you run sysctl command?</summary><br><b>
If you `strace` the sysctl command you can see it does it by changing the file under /proc/sys/...
In the past it was done with sysctl system call, but it was deprecated at some point.
</b></details>
<details>
<summary>How changes to kernel runtime parameters persist? (applied even after reboot to the system for example)</summary><br><b>
There is a service called `systemd-sysctl` that takes the content of /etc/sysctl.conf and applies it. This is how changes persist, even after reboot, when they are written in /etc/sysctl.conf
</b></details>
<details>
<summary>Are the changes you make to kernel parameters in a container, affects also the kernel parameters of the host on which the container runs?</summary><br><b>
No. Containers have their own /proc filesystem so any change to kernel parameters inside a container, are not affecting the host or other containers running on that host.
</b></details>
#### Linux - SSH
<details>
@ -2342,6 +2416,21 @@ MemAvailable - The amount of available memory for new workloads (without pushing
#### Linux - Misc
<details>
<summary>How to generate a random string?</summary><br><b>
One way is to run the following: `cat /proc/sys/kernel/random/uuid`
</b></details>
<details>
<summary>What is a Linux distribution?</summary><br><b>
* A collection of packages - kernel, GNU, third party apps, ...
* Sometimes distributions store some information on the distribution in `/etc/*-release` file
* For example for Red Hat distribution it will be `/etc/redhat-release` and for Amazon it will be `/etc/os-release`
* `lsb_release` is a common command you can use in multiple different distributions
</b></details>
<details>
<summary>Name 5 commands which are two letters long</summary><br><b>
@ -2615,242 +2704,6 @@ Yes, it's a operating-system-level virtualization, where the kernel is shared an
The introduction of virtual machines allowed companies to deploy multiple business applications on the same hardware while each application is separated from each other in secured way, where each is running on its own separate operating system.
</b></details>
## Programming
<details>
<summary>What programming language do you prefer to use for DevOps related tasks? Why specifically this one?</summary><br><b>
</b></details>
<details>
<summary>What are static typed (or simply typed) languages?</summary><br><b>
In static typed languages the variable type is known at compile-time instead of at run-time.
Such languages are: C, C++ and Java
</b></details>
<details>
<summary>Explain expressions and statements</summary><br><b>
An expression is anything that results in a value (even if the value is None). Basically, any sequence of literals so, you can say that a string, integer, list, ... are all expressions.
Statements are instructions executed by the interpreter like variable assignments, for loops and conditionals (if-else).
</b></details>
<details>
<summary>What is Object Oriented Programming? Why is it important?</summary><br><b>
</b></details>
<details>
<summary>Explain Composition</summary><br><b>
</b></details>
<details>
<summary>What is a compiler?</summary><br><b>
</b></details>
<details>
<summary>What is an interpreter?</summary><br><b>
</b></details>
<details>
<summary>Are you familiar with SOLID design principles?</summary><br><b>
SOLID design principles are about:
* Make it easier to extend the functionality of the system
* Make the code more readable and easier to maintain
SOLID is:
* Single Responsibility - A class should only have a single responsibility
* Open-Closed - An entity should be open for extension, but closed for modification. What this practically means is that you should extend functionality by adding a new code and not by modifying it. Your system should be separated into components so it can be easily extended without breaking everything.
* Liskov Substitution - Any derived class should be able to substitute the its parent without altering its corrections. Practically, every part of the code will get the expected result no matter which part is using it
* Interface segregation - A client should never depend on anything it doesn't uses
* Dependency Inversion - High level modules should depend on abstractions, not low level modules
</b></details>
<details>
<summary>What is YAGNI? What is your opinion on it?</summary><br><b>
</b></details>
<details>
<summary>What is DRY? What is your opinion on it?</summary><br><b>
</b></details>
<details>
<summary>What are the four pillars of object oriented programming?</summary><br><b>
</b></details>
<details>
<summary>Explain recursion</summary><br><b>
</b></details>
<details>
<summary>Explain Inversion of Control</summary><br><b>
</b></details>
<details>
<summary>Explain Dependency Injection</summary><br><b>
</b></details>
<details>
<summary>True or False? In Dynamically typed languages the variable type is known at run-time instead of at compile-time</summary><br><b>
True
</b></details>
<details>
<summary>Explain what are design patterns and describe three of them in detail</summary><br><b>
</b></details>
<details>
<summary>Explain big O notation</summary><br><b>
</b></details>
<details>
<summary>What is "Duck Typing"?</summary><br><b>
</b></details>
<details>
<summary>Explain string interpolation</summary><br><b>
</b></details>
##### Common algorithms
<details>
<summary>Binary search:
* How does it works?
* Can you implement it? (in any language you prefer)
* What is the average performance of the algorithm you wrote?</summary><br><b>
It's a search algorithm used with sorted arrays/lists to find a target value by dividing the array each iteration and comparing the middle value to the target value. If the middle value is smaller than target value, then the target value is searched in the right part of the divided array, else in the left side. This continues until the value is found (or the array divided max times)
[python implementation](coding/python/binary_search.py)
The average performance of the above algorithm is O(log n). Best performance can be O(1) and worst O(log n).
</b></details>
##### Code Review
<details>
<summary>What are your code-review best practices?</summary><br><b>
</b></details>
<details>
<summary>Do you agree/disagree with each of the following statements and why?:
* The commit message is not important. When reviewing a change/patch one should focus on the actual change
* You shouldn't test your code before submitting it. This is what CI/CD exists for.</summary><br><b>
</b></details>
#### Strings
<details>
<summary>In any language you want, write a function to determine if a given string is a palindrome</summary><br><b>
</b></details>
<details>
<summary>In any language you want, write a function to determine if two strings are Anagrams </summary><br><b>
</b></details>
#### Integers
<details>
<summary>In any language you would like, print the numbers from 1 to a given integer. For example for input: 5, the output is: 12345</summary><br><b>
</b></details>
#### Time Complexity
<details>
<summary>Describe what would be the time complexity of the operations <code>access</code>, <code>search</code> <code>insert</code> and <code>remove</code> for the following data structures:</summary><br><b>
* Stack
* Queue
* Linked List
* Binary Search Tree
</b></details>
<details>
<summary>What is the complexity for the best, worst and average cases of each of the following algorithms?:
* Quick sort
* Merge sort
* Bucket Sort
* Radix Sort</summary><br><b>
</b></details>
#### Data Structures & Types
<details>
<summary>Implement Stack in any language you would like</summary><br><b>
</b></details>
<details>
<summary>Tell me everything you know about Linked Lists</summary><br><b>
* A linked list is a data structure
* It consists of a collection of nodes. Together these nodes represent a sequence
* Useful for use cases where you need to insert or remove an element from any position of the linked list
* Some programming languages don't have linked lists as a built-in data type (like Python for example) but it can be easily implemented
</b></details>
<details>
<summary>Describe (no need to implement) how to detect a loop in a Linked List</summary><br><b>
There are multiple ways to detect a loop in a linked list. I'll mention three here:
Worst solution:<br>
Two pointers where one points to the head and one points to the last node. Each time you advance the last pointer by one and check whether the distance between head pointer to the moved pointer is bigger than the last time you measured the same distance (if not, you have a loop).<br>
The reason it's probably the worst solution, is because time complexity here is O(n^2)
Decent solution:<br>
Create an hash table and start traversing the linked list. Every time you move, check whether the node you moved to is in the hash table. If it isn't, insert it to the hash table. If you do find at any point the node in the hash table, it means you have a loop. When you reach None/Null, it's the end and you can return "no loop" value.
This one is very easy to implement (just create a hash table, update it and check whether the node is in the hash table every time you move to the next node) but since the auxiliary space is O(n) because you create a hash table then, it's not the best solution
Good solution:<br>
Instead of creating a hash table to document which nodes in the linked list you have visited, as in the previous solution, you can modify the Linked List (or the Node to be precise) to have a "visited" attribute. Every time you visit a node, you set "visited" to True.<br>
Time compleixty is O(n) and Auxiliary space is O(1), so it's a good solution but the only problem, is that you have to modify the Linked List.
Best solution:<br>
You set two pointers to traverse the linked list from the beginning. You move one pointer by one each time and the other pointer by two. If at any point they meet, you have a loop. This solution is also called "Floyd's Cycle-Finding"<br>
Time complexity is O(n) and auxiliary space is O(1). Perfect :)
</b></details>
<details>
<summary>Implement Hash table in any language you would like</summary><br><b>
</b></details>
<details>
<summary>What is Integer Overflow? How is it handled?</summary><br><b>
</b></details>
<details>
<summary>Name 3 design patterns. Do you know how to implement (= provide an example) these design pattern in any language you'll choose?</summary><br><b>
</b></details>
<details>
<summary>Given an array/list of integers, find 3 integers which are adding up to 0 (in any language you would like)</summary><br><b>
```
def find_triplets_sum_to_zero(li):
li = sorted(li)
for i, val in enumerate(li):
low, up = 0, len(li)-1
while low < i < up:
tmp = var + li[low] + li[up]
if tmp > 0:
up -= 1
elif tmp < 0:
low += 1
else:
yield li[low], val, li[up]
low += 1
up -= 1
```
</b></details>
## Python
### Python Exercises

View File

@ -68,6 +68,14 @@ Note 2: Some of the exercises cost money and can't be performed using the free t
|--------|--------|------|----|----|
Register Domain | Route 53 | [Exercise](register_domain.md) | [Solution](solutions/register_domain.md) | Easy |
Creating Records | Route 53 | [Exercise](creating_records.md) | [Solution](solutions/creating_records.md) | Easy |
Health Checks | Route 53 | [Exercise](health_checks.md) | [Solution](solutions/health_checks.md) | Easy |
Failover | Route 53 | [Exercise](route_53_failover.md) | [Solution](solutions/route_53_failover.md) | Easy |
#### AWS - Containers
|Name|Topic|Objective & Instructions|Solution|Comments|
|--------|--------|------|----|----|
| ECS Task | ECS, Fargate | [Exercise](ecs_task.md) | [Solution](solutions/ecs_task.md) | Easy |
#### AWS - Lambda
@ -877,30 +885,76 @@ False. Charges are being made when the code is executed.
True
</b></details>
#### AWS Containers
#### AWS - Containers
##### AWS Containers - ECS
<details>
<summary>What is Amazon ECS?</summary><br><b>
Amazon definition: "Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service. Customers such as Duolingo, Samsung, GE, and Cook Pad use ECS to run their most sensitive and mission critical applications because of its security, reliability, and scalability."
[AWS Docs](https://aws.amazon.com/ecs): "Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service. Customers such as Duolingo, Samsung, GE, and Cook Pad use ECS to run their most sensitive and mission critical applications because of its security, reliability, and scalability."
Learn more [here](https://aws.amazon.com/ecs)
In simpler words, it allows you to launch containers on AWS.<br>
While AWS takes care of starting/stopping containers, you need to provision and maintain the infrastructure where the containers are running (EC2 instances).
</b></details>
<details>
<summary>What one should do in order to make EC2 instance part of an ECS cluster?</summary><br><b>
Install ECS agent on it. Some AMIs have built-in configuration for that.
</b></details>
<details>
<summary>What ECS launch types are there?</summary><br><b>
* EC2 Instance
* AWS Fargate
</b></details>
<details>
<summary>What is Amazon ECR?</summary><br><b>
Amazon definition: "Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images."
Learn more [here](https://aws.amazon.com/ecr)
[AWS Docs](https://aws.amazon.com/ecr): "Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images."
</b></details>
<details>
<summary>What the role "EC2 Instance Profile" is used for in regards to ECS?</summary><br><b>
EC2 Instance Profile used by ECS agent on an EC2 instance to:
* Make API calls to ECS Service
* Send logs to CloudWatch from the container
* Use secrets defined in SSM Parameter Store or Secrets Manager
* Pull container images from ECR (Registry)
</b></details>
<details>
<summary>How to share data between containers (some from ECS and some from Fargate)?</summary><br><b>
Using EFS is a good way to share data between containers and it works also between different AZs.
</b></details>
##### AWS Containers - Fargate
<details>
<summary>What is AWS Fargate?</summary><br><b>
Amazon definition: "AWS Fargate is a serverless compute engine for containers that works with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS)."
[Amazon Docs](https://aws.amazon.com/fargate): "AWS Fargate is a serverless, pay-as-you-go compute engine that lets you focus on building applications without managing servers. AWS Fargate is compatible with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS)"
Learn more [here](https://aws.amazon.com/fargate)
In simpler words, AWS Fargate allows you launch containers on AWS without worrying about managing infrastructure. It runs containers based on the CPU and RAM you need.
</b></details>
<details>
<summary>How AWS Fargate different from AWS ECS?</summary><br><b>
In AWS ECS, you manage the infrastructure - you need to provision and configure the EC2 instances.<br>
While in AWS Fargate, you don't provision or manage the infrastructure, you simply focus on launching Docker containers. You can think of it as the serverless version of AWS ECS.
</b></details>
<details>
<summary>True or False? Fargate creates an ENI for every task it runs</summary><br><b>
True.
</b></details>
#### AWS - S3
@ -908,10 +962,8 @@ Learn more [here](https://aws.amazon.com/fargate)
<details>
<summary>Explain what is AWS S3?</summary><br><b>
S3 stands for 3 S, Simple Storage Service.
S3 stands for: Simple Storage Service.<br>
S3 is a object storage service which is fast, scalable and durable. S3 enables customers to upload, download or store any file or object that is up to 5 TB in size.
More on S3 [here](https://aws.amazon.com/s3)
</b></details>
<details>
@ -1941,6 +1993,12 @@ Use Elastic IP which provides you a fixed IP address.
[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>Why would you use an Elastic IP address?</summary><br><b>
Let's say you have an instance that you need to shutdown or perform some maintenance on. In that case, what you would want to do is to move the Elastic IP address to another instance that is operational, until you finish to perform the maintenance and then you can move it back to the original instance (or keep it assigned to the second one).
</b></details>
<details>
<summary>True or False? When stopping and starting an EC2 instance, its public IP changes</summary><br><b>
@ -2366,6 +2424,147 @@ True
<details>
<summary>What is a routing policy in regards to AWS Route 53?</summary><br><b>
A routing policy routing defines how Route 53 responds to DNS queries.
</b></details>
<details>
<summary>What Route 53 routing policies are there?</summary><br><b>
* Simple
* Geolocation
* Failover
* Latency based
* Geoproximity
* Multi-Value Answer
* Weighted
</b></details>
<details>
<summary>Suppose you need to route % of your traffic to a certain instance and the rest of the traffic, to another instance. Which routing policy would you choose?</summary><br><b>
Weighted routing policy.
</b></details>
<details>
<summary>Suppose you need to route traffic to a single source with Route 53, without any other requirements, which routing policy would you choose?</summary><br><b>
The `simple` routing policy
</b></details>
<details>
<summary>Explain the geolocation routing policy</summary><br><b>
* Routing based on user location
* Location can be specified by continent, country or US state
* It's recommended to have a default record in case there is no match on location
</b></details>
<details>
<summary>What are some use cases for using geolocation routing policy?</summary><br><b>
* Restrict content distribution
* App localization
* Load balancing
</b></details>
<details>
<summary>Explain the geoproximity routing policy</summary><br><b>
* Route based on the geographic location of resources
* Shifting routing is done based on the `bias` value
* Resources can be of AWS and non-AWS type
* For non-AWS you have to specify latitude and longitude in addition to AWS region as done in AWS-based resources
* To use it, you have to use Route 53 traffic flow
</b></details>
<details>
<summary>What are some use cases for <code>weighted</code> routing policy?</summary><br><b>
* Load balancing between regions
* Testing new applications versions
</b></details>
<details>
<summary>True or False? Route 53 <code>simple</code> routing policy supports both single and multiple values</summary><br><b>
True.
If multiple values are returned from Route 53 then, the client chooses a single value to use.
</b></details>
<details>
<summary>True or False? In <code>weighted</code> routing DNS records must have the same name but not the same type</summary><br><b>
False. They must have the same name AND type.
</b></details>
<details>
<summary>You would like to use a routing policy that will take latency into account and will route to the resource with the lowest latency. Which routing policy would you use?</summary><br><b>
Latency-based routing policy.
</b></details>
<details>
<summary>What happens when you set all records to weight 0 when using <code>Weighted</code> routing policy?</summary><br><b>
All records are used equally.
</b></details>
<details>
<summary>What Route 53 health checks are used for?</summary><br><b>
Automated DNS failover based on monitoring:
* Another health check
* endpoint (app, AWS resource, server)
* CloudWatch alarms
</b></details>
<details>
<summary>You would like to use a routing policy based on the resource location and be able to shift more traffic to some resources. Which one would you use?</summary><br><b>
Geoproximity routing policy
</b></details>
<details>
<summary>Explain Route 53 Traffic Flow feature</summary><br><b>
It's a visual editor for managing complex routing decision trees. It allows you to simplify the process of managing records.
Configuration can be saved (as Traffic Flow Policy) and applied to different domains/hosted zones. In addition, it supports versioning
</b></details>
<details>
<summary>What are calculated health checks?</summary><br><b>
When you combine the results of multiple health checks into a single health check.
</b></details>
<details>
<summary>What is one possible use case for using calculated health checks?</summary><br><b>
Performing maintenance for a website without causing all the health checks to fail.
</b></details>
<details>
<summary>You would like to use a routing policy based on the user location. Which one would you use?</summary><br><b>
Geolocation routing policy. It's based on user location.
Don't confuse it with latency-based routing policy. While shorter distance may result in lower latency, this is not the requirement in the question.
</b></details>
<details>
<summary>True or False? Route 53 Multi Value is a substitute for those who want cheaper solution than ELB</summary><br><b>
False. Route 53 Multi Value is not a substitute for ELB. It's focused on client-side load balancing as opposed to ELB.
</b></details>
<details>
<summary>True or False? Domain registrar and DNS service is inherently the same thing</summary><br><b>
False. DNS service can be Route 53 (where you manage DNS records) while the domain itself can be purchased from other sources that aren't Amazon related (e.g. GoDadday).
</b></details>
#### AWS Monitoring & Logging
@ -2798,6 +2997,20 @@ Yes, using SNI (Server Name Indication) each application can has its own SSL cer
Read Replicas use asynchronous replication so it's possible users access a read replica instance that wasn't synced yet.
</b></details>
<details>
<summary>You need a persistent shared storage between your containers that some are running in Fargate and some in ECS. What would you use?</summary><br><b>
EFS. It allows us to have persistent multi-AZ shared storage for containers.
</b></details>
<details>
<summary>You would like to run an AWS Fargate task every time a file is uploaded to a certain S3 bucket. How would you achieve that?</summary><br><b>
Use Amazon EventBridge so every time a file is uploaded to an S3 bucket (event) it will run an ECS task.
Such task should have an ECS Task Role so it can get the object from the S3 bucket (and possibly other permissions if it needs to update the DB for example).
</b></details>
#### AWS - Architecture Design
<details>

View File

@ -0,0 +1,14 @@
## AWS Route 53 - Health Checks
## Requirements
3 web instances in different AZs.
## Objectives
1. For each instance create a health checks with the following properties:
1. Name it after the AZ where the instance resides
2. Failure threshold should be 5
2. Edit the security group of one of your instances and remove HTTP rules.
1. Did it change the status of the health check?

View File

@ -0,0 +1,11 @@
## AWS Route 53 - Failover
### Requirements
A running EC2 web instance with an health check defined for it in Route 53
### Objectives
1. Create a failover record that will failover to another record if an health check isn't passing
1. Make sure TTL is 30
2. Associate the failover record with the health check you have

View File

@ -0,0 +1,33 @@
## AWS Route 53 - Health Checks
## Requirements
3 web instances in different AZs.
## Objectives
1. For each instance create a health checks with the following properties:
1. Name it after the AZ where the instance resides
2. Failure threshold should be 5
2. Edit the security group of one of your instances and remove HTTP rules.
1. Did it change the status of the health check?
### Solution
#### Console
1. Go to Route 53
2. Click on "Health Checks" in the left-side menu
3. Click on "Create health check"
4. Insert the name: us-east-2
5. What to monitor: endpoint
6. Insert the IP address of the instance
7. Insert the endpoint /health if your web instance supports that endpoint
8. In advanced configuration, set Failure threshold to 5
9. Click on "next" and then on "Create health check"
10. Repeat steps 1-9 for the other two instances you have
1. Go to security group of one of your instances
2. Click on "Actions" -> Edit inbound rules -> Delete HTTP based rules
3. Go back to health checks page and after a couple of seconds you should see that the status becomes "unhealthy"

View File

@ -0,0 +1,29 @@
## AWS Route 53 - Failover
### Requirements
A running EC2 web instance with an health check defined for it in Route 53
### Objectives
1. Create a failover record that will failover to another record if an health check isn't passing
1. Make sure TTL is 30
2. Associate the failover record with the health check you have
### Solution
#### Console
1. Go to Route 53 service
2. Click on "Hosted Zones" in the left-side menu
3. Click on your hosted zone
4. Click on "Created record"
5. Insert "failover" in record name and set record type to A
6. Insert the IP of your instance
7. Set the routing policy to failover
8. Set TTL to 30
9. Associate with an health check
10. Add another record with the same properties as the previous one
11. Click on "Create records"
12. Go to your EC2 instance and edit its security group to remove the HTTP rules
13. Use your web app and if you print the hotsname of your instance then you will notice, a failover was performed and a different EC2 instance is used

View File

@ -59,6 +59,16 @@ Things to think about:
* Do DevOps teams or engineers have to be innovative or practice innovation as part of their role?
</b></details>
<details>
<summary>One of your team members suggests to set a goal of "deploying at least 20 times a day" in regards to CD. What is your take on that?</summary><br><b>
A couple of thoughts:
1. Why is it an important goal? Is it affecting the business somehow? One of the KPIs? In other words, does it matters?
2. This might introduce risks such as losing quality in favor of quantity
3. You might want to set a possibly better goal such as "be able to deploy whenever we need to deploy"
</b></details>
#### Tooling
<details>