Skip to content

Commit 7cceb86

Browse files
committed
Update
1 parent d2f681f commit 7cceb86

File tree

17 files changed

+672
-318
lines changed

17 files changed

+672
-318
lines changed

README.md

+2-318
Large diffs are not rendered by default.

images/logos/datadog.png

105 KB
Loading

topics/datadog/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DataDog
2+
3+
## Questions
4+
5+
TODO

topics/gcp/README.md

+452
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Assign Roles
2+
3+
## Objectives
4+
5+
1. Assign the following roles to a member in your organization
6+
1. Compute Storage Admin
7+
2. Compute Network Admin
8+
3. Compute Security Admin
9+
2. Verify roles were assigned
10+
11+
## Solution
12+
13+
Click [here](solution.md) to view the solution
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
locals {
2+
roles = [
3+
"roles/compute.storageAdmin",
4+
"roles/compute.networkAdmin",
5+
"roles/compute.securityAdmin"
6+
]
7+
}
8+
9+
resource "google_service_account" "some_member" {
10+
account_id = "${substr(var.env_id, 0, min(length(var.env_id), 10))}-some-member"
11+
display_name = "${var.env_id} some-member"
12+
}
13+
14+
resource "google_project_iam_member" "storageAdminMaster" {
15+
for_each = toset(concat(local.roles))
16+
project = "${var.project_id}"
17+
role = each.key
18+
member = "serviceAccount:${google_service_account.some_member.email}"
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Assign Roles
2+
3+
## Objectives
4+
5+
1. Assign the following roles to a member in your organization
6+
1. Compute Storage Admin
7+
2. Compute Network Admin
8+
3. Compute Security Admin
9+
2. Verify roles were assigned
10+
11+
## Solution
12+
13+
### Console
14+
15+
1. Go to IAM & Admin
16+
2. Click on IAM and then on the "Add" button
17+
1. Choose the member account to whom the roles will be added
18+
2. Under select role, search for the specified roles under "Objectives" and click on "Save"
19+
2. The member should now be able to go to the compute engine API and see the resources there.
20+
21+
### Terraform
22+
23+
Click [here](main.tf) to view the Terraform main.tf file
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
variable "project_id" {
2+
type = string
3+
}
4+
5+
variable "env_id" {
6+
type = string
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">=1.3.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 4.10.0, < 5.0"
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Create a Project
2+
3+
## Objectives
4+
5+
1. Create a project with a unique name
6+
7+
## Solution
8+
9+
Click [here](solution.md) to view the solution
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
resource "google_project" "gcp_project" {
2+
name = "Some Project"
3+
project_id = "some-unique-project-id"
4+
folder_id = google_folder.some_folder.name
5+
}
6+
7+
resource "google_folder" "some_folder" {
8+
display_name = "Department 1"
9+
parent = "organizations/some-organization"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Create a Project
2+
3+
## Objectives
4+
5+
1. Create a project with a unique name
6+
7+
## Solution
8+
9+
### Console
10+
11+
1. Click in the top bar on "New Project" (if you already have a project then, click on the project name and then "New Project") or in the search bar insert "Create Project".
12+
2. Insert a globally unique project name
13+
3. Optionally choose an organization
14+
4. Optionally put it under a specific folder
15+
5. Click on "Create" :)
16+
17+
### Terraform
18+
19+
Click [here](main.tf) to view the solution
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">=1.3.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 4.10.0, < 5.0"
8+
}
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Create an Instance
2+
3+
## Objectives
4+
5+
1. Create a VM instance with the following properties
6+
1. name: instance-1
7+
2. type: e2-micro
8+
3. labels:
9+
1. app: web
10+
2. env: dev
11+
2. Using the CLI (gcloud) perform the following operations:
12+
1. Update "app" label to "db"
13+
2. Remove "env" label
14+
15+
## Solution
16+
17+
Click [here](solution.md) to view the solution
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "google_compute_network" "vpc_network" {
2+
name = "my-custom-mode-network"
3+
auto_create_subnetworks = false
4+
mtu = 1460
5+
}
6+
7+
resource "google_compute_subnetwork" "default" {
8+
name = "my-custom-subnet"
9+
ip_cidr_range = "10.0.1.0/24"
10+
region = "us-west1"
11+
network = google_compute_network.vpc_network.id
12+
}
13+
14+
resource "google_compute_instance" "default" {
15+
name = "instance-1"
16+
machine_type = "e2-micro"
17+
zone = "us-west1-a"
18+
labels = {
19+
app = "db"
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Create an Instance
2+
3+
## Objectives
4+
5+
1. Create a VM instance with the following properties
6+
1. name: instance-1
7+
2. type: e2-micro
8+
3. labels:
9+
1. app: web
10+
2. env: dev
11+
2. Using the CLI (gcloud) perform the following operations:
12+
1. Update "app" label to "db"
13+
2. Remove "env" label
14+
15+
## Solution
16+
17+
### Console
18+
19+
1. Go to Compute Engine -> VM instances
20+
2. Click on "Create Instance"
21+
1. Insert the name "instance-1"
22+
2. Click on "Add label" and add the following labels:
23+
1. app: web
24+
2. env: dev
25+
3. Choose machine type: e2-micro
26+
3. Click on "Create"
27+
4. Selected the created instance and click on "show info panel"
28+
1. Click on "labels" tab and change the value of "app" label to "db"
29+
2. Remove the "env" label
30+
31+
### Shell
32+
33+
```
34+
gcloud config set project <PROJECT_ID>
35+
gcloud config set compute/region <REGION NAME>
36+
gcloud config set compute/zone <ZONE NAME>
37+
38+
gcloud compute instances create instance-1 --labels app=web,env=dev --machine-type=e2-micro
39+
gcloud compute instances update instance-1 --update-labels app=db
40+
gcloud compute instances update instance-1 --remove-labels env
41+
```
42+
43+
### Terraform
44+
45+
Click [here](main.tf) to view the main.tf file
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">=1.3.0"
3+
4+
required_providers {
5+
google = {
6+
source = "hashicorp/google"
7+
version = ">= 4.10.0, < 5.0"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)