Skip to content

[pull] master from bregman-arie:master #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ With <code>var x int = 2</code> we are setting the variable type to integer whil
<details>
<summary>True or False? In Go we can redeclare variables and once declared we must use it.</summary>

False. We can't redeclare variables but yes, we must used declared variables.
False. We can't redeclare variables but yes, we must use declared variables.
</b></details>

<details>
Expand Down
13 changes: 13 additions & 0 deletions exercises/shell/solutions/directories_comparision.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## How to compare two directories in Linux?

You can use the 'diff' command with the '-r' flag to compare two direcotries recursively.



### Example:
'''bash
diff -r folder1/ folder2/

This command compares all the files and subdirectories inside 'folder1' and 'folder2'.
If both directories have identical contents, it retuns nothing.
If there are differences,it showss which files differ or are missing.
5 changes: 5 additions & 0 deletions topics/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,11 @@ True
A transport solution which was designed for transferring large amounts of data (petabyte-scale) into and out the AWS cloud.
</b></details>

<details>
<summary> How can a company ensure their web application continues to operate if it becomes unavailable in its current single region?</summary><br><b>
Deploy the application in multiple Regions. Use Amazon Route 53 DNS health checks to route traffic to a healthy Region
</b></details>

### ELB

<details>
Expand Down
3 changes: 1 addition & 2 deletions topics/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@ True

<details>
<summary>You have two branches - main and devel. How do you make sure devel is in sync with main?</summary><br><b>
<code>

```
git checkout main
git pull
git checkout devel
git merge main
```
</code>

</b></details>

Expand Down
2 changes: 1 addition & 1 deletion topics/os/fork_102.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Fork 101
## Fork 102

Answer the questions given the following program (without running it):

Expand Down
31 changes: 31 additions & 0 deletions topics/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
|--------|--------|------|----|----|
| Launch EC2 instance | EC2 | [Exercise](exercises/launch_ec2_instance/exercise.md) | [Solution](exercises/launch_ec2_instance/solution.md) | |
| Rename S3 bucket | S3 | [Exercise](exercises/s3_bucket_rename/exercise.md) | [Solution](exercises/s3_bucket_rename/solution.md) | |
| Create Custom VPC and Subnets | VPC | [Exercise](exercises/vpc_subnet_creation/exercise.md) | [Solution](exercises/vpc_subnet_creation/solution.md) | |

## Questions

Expand All @@ -74,6 +75,17 @@
-
</b></details>

<details>
<summary>What is one reason why manual processes can be helpful?</summary><br><b>
For learning a platform when first starting out
</b></details>

<details>
<summary>Why is it advisable to avoid using manual processes when creating infrastructure at scale?</summary>
Manual processes for creating infrastructure are slow because they require human intervention for each step, which delays deployment. They are error-prone since manual configuration increases the risk of mistakes and inconsistencies. Additionally, these processes are not easily repeatable, making it difficult to ensure the same infrastructure setup across different environments—unlike Infrastructure as Code (IaC), which automates and standardizes deployments.
</b></details>


<details>
<summary>What are some of Terraform features?</summary><br><b>

Expand Down Expand Up @@ -401,6 +413,18 @@ If no value given, user will be prompted to provide one.
Using the syntax `var.<VAR_NAME>`
</b></details>

<details>
[Question] You are configuring a variable for your Terraform configuration. Which arguments are required when configuring a `variable` block? 1. `type` and `description` 2. There are no required arguments 3. `type` 4. `type`, `description` and `default`

[Answer]</b> 2. There are no required arguments

In Terraform, when declaring a variable block, there are no mandatory arguments. You can create a variable with an empty block like:

variable "example" {}

While `type`, `description`, and `default` are commonly used, they're all optional. The `type` argument helps with validation, `description` documents the variable's purpose, and `default` provides a fallback value if none is specified.
</details>

<details>
<summary>What is the effect of setting variable as "sensitive"?</summary><br><b>

Expand Down Expand Up @@ -946,6 +970,13 @@ You can use it the following syntax `data.terraform_remote_state.<NAME>.outputs.

</b></details>

<details>
<summary>How does a remote state backend improve collaboration for a Terraform project?</summary><br><b>

By storing the state file in a shared location enabling multiple people or processes to work with the same state.
A remote state backend improves collaboration on Terraform projects by addressing the core challenge of sharing infrastructure state. When a team works on infrastructure, everyone needs access to the current state to safely make changes.
</b></details>

#### Workspaces

<details>
Expand Down
19 changes: 19 additions & 0 deletions topics/terraform/exercises/vpc_subnet_creation/exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Creating Custom VPC and Subnets with Terraform

## Requirements
* An existing AWS account with permissions to create VPCs and subnets.
* Terraform installed on your local machine.
* AWS CLI configured with your credentials.


## Objectives
1. Create a custom VPC with a specified CIDR block.
For example, you can use `10.0.0.0/16`.
2. Create two subnets within the VPC, each with a different CIDR block.
For example, you can use `10.0.0.0/20` for the first subnet and `10.0.16.0/20` for the second subnet.

Both subnets should be in different availability zones to ensure high availability.
3. Ensure that the VPC and subnets are tracked by Terraform.

## Solution
Click [here to view the solution](solution.md)
78 changes: 78 additions & 0 deletions topics/terraform/exercises/vpc_subnet_creation/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Creating Custom VPC and Subnets with Terraform


## Objectives
1. Create a custom VPC with a specified CIDR block.
For example, you can use `10.0.0.0/16`.
2. Create two subnets within the VPC, each with a different CIDR block.
For example, you can use `10.0.0.0/20` for the first subnet and `10.0.16.0/20` for the second subnet.

Both subnets should be in different availability zones to ensure high availability.
3. Ensure that the VPC and subnets are tracked by Terraform.


## Solution



```sh
# Create a directory for the Terraform configuration
mkdir vpc_subnet_creation && cd vpc_subnet_creation
```

```sh
# Create the main.tf file with the VPC and subnets configuration
touch main.tf
```

```terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}

provider "aws" {
region = "your-region" # e.g., ap-south-1
}

resource "aws_vpc" "my_custom_vpc" {
cidr_block = "10.0.0.0/16"
tags = {
Name = "my_custom_vpc_made_with_terraform"
}
}

resource "aws_subnet" "Subnet_A" {
cidr_block = "10.0.0.0/20"
vpc_id = aws_vpc.my_custom_vpc.id
availability_zone = "your-availability-zone-a" # e.g., ap-south-1a
tags = {
"Name" = "Subnet A"
}
}
resource "aws_subnet" "Subnet_B" {
cidr_block = "10.0.16.0/20"
vpc_id = aws_vpc.my_custom_vpc.id
availability_zone = "your-availability-zone-b" # e.g., ap-south-1b
tags = {
"Name" = "Subnet B"
}
}
```

```sh
# Initialize Terraform to download the AWS provider
terraform init
```

```sh
# Apply the Terraform configuration to create the VPC and subnets
terraform apply -auto-approve
```