You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -6,27 +6,29 @@ A part of the setup will be done on your **local machine** but most of the confi
6
6
7
7
Please **read instructions carefully and execute all commands in the following order**. If you get stuck, don't hesitate to ask a teacher for help :raising_hand:
8
8
9
-
This setup is largely automated with **Terraform** and **Ansible**. There are three main components to the setup! **Terraform** and **ansible** are _Infrastructure as Code_ tools.
9
+
This setup is largely automated with [**Terraform**🔗](https://developer.hashicorp.com/terraform)and [**Ansible** 🔗](https://docs.ansible.com/). **Terraform** and **ansible** are [_Infrastructure as Code_ 🔗](https://en.wikipedia.org/wiki/Infrastructure_as_code) tools.
10
10
-**Terraform** excels at creating and destroying cloud resources, like virtual machines, IP addresses, databases and more!
11
-
-**Ansible** is used to configure linux machines with specific settings and software. Perfect for fine-tuning the Virtual Machine you will be creating!
11
+
-**Ansible** is used to configure linux machines with specific settings and software. Perfect for fine-tuning the Virtual Machine you will be creating with Terraform!
12
+
13
+
There are three main components to the setup!
12
14
13
15
## Part 1: Setup your local computer
14
16
15
-
In this section you'll setup your local computer and create some accounts. It will include things like:
16
-
1.Install some communication tools: Zoom, Slack
17
+
In this section you'll setup your local computer and create some accounts. It will include:
18
+
1.Installing the primary communication tool you'll use on the bootcamp: **Slack**!
17
19
2. Create some accounts: Github, Google Cloud Platform (GCP)
18
-
3. Install Visual Studio Code (VS Code)
20
+
3. Install **Visual Studio Code (VS Code)**
19
21
4. Install and authentication the GCP command line tool: `gcloud`
20
-
5. Install **terraform** on your local computer
21
-
6. Create your virtual machine with **terraform** and connect to it with **VS Code**!
22
+
5. Install **Terraform** on your local computer
23
+
6. Create your virtual machine with **Terraform** and connect to it with **VS Code**!
22
24
23
25
## Part 2: Configure your Virtual Machine Part 1
24
26
25
27
All parts of this section happen on your virtual machine.
26
28
27
29
This section includes:
28
30
1. Authenticate your virtual machine with `gcloud`
29
-
2. Download and run an **ansible** playbook to partially configure your virtual machine
31
+
2. Download and run an **Ansible** playbook to partially configure your virtual machine
30
32
3. Login to the Github command line tool on your virtual machine
31
33
4. Copy the Le Wagon recommended **dotfiles**. **Dotfiles** are settings that will enhance your terminal and developer experience!
32
34
@@ -35,15 +37,18 @@ This section includes:
35
37
All parts of this section happen on your virtual machine.
36
38
37
39
In this section you will:
38
-
1. Download and run a second **ansible** playbook for some more fine tuning
40
+
1. Download and run a second **Ansible** playbook for some more VM fine tuning
39
41
2. Test your set up to make sure that everything has installed correctly
40
42
3. Create isolated python environments for all your challenges
41
43
42
-
43
44
Don't worry, we'll go into more detail in each of the individual sections.
44
45
45
46
Let's start :rocket:
46
47
48
+
---
49
+
50
+
# Part 1: Local Setup
51
+
47
52
48
53
## Slack
49
54
@@ -225,24 +230,31 @@ Once the verification goes through, you should receive an email stating that "Yo
225
230
226
231
## GCP APIs
227
232
228
-
You will use different GCP services during the bootcamp which needs to be activated and configured.
233
+
When you create a GCP Project, not every service is enabled by default. To enable a service (like using a VM or storing a Docker image in Artifact Registry) you have to enable the GCP API for that service.
229
234
230
235
### Default APIs
231
236
232
-
Go to your project [APIs dashboard](https://console.cloud.google.com/apis/dashboard), you can see a bunch of APIs are already enabled:
237
+
Go to your project [APIs dashboard 🔗](https://console.cloud.google.com/apis/dashboard), you can see a bunch of APIs are already enabled:
You'll need to enable some additional API's so that Terraform can create cloud resources on your behalf.
244
+
245
+
**Cloud Resource Manager**
237
246
238
-
**👌 Note: Skip to the next section if you already have Compute Engine enabled**
247
+
On the [APIs dashboard 🔗](https://console.cloud.google.com/apis/dashboard) page, click on [Enable APIs and services 🔗](https://console.cloud.google.com/apis/library) and make sure your project is selected in the box in the top left.
239
248
240
-
- In the search bar, type _compute_ and click on the Compute Engine result
Navigate back to the [APIs and Services 🔗](https://console.cloud.google.com/apis/library) page and search for: _service usage api_ and select the top result: **Service Usage API**. On the next page, click on **Enable**. ❗ This API might already enabled - not a problem if it is!
254
+
255
+
**Compute Engine**
256
+
257
+
Navigate back to the [APIs and Services 🔗](https://console.cloud.google.com/apis/library) page and search for: _compute engine api_ and select: **Compute Engine API**. On the next page, click on **Enable**. ❗ This API might already enabled - not a problem if it is!
246
258
247
259
248
260
## Visual Studio Code
@@ -315,6 +327,9 @@ The `gcloud` Command Line Interface (CLI) is used to communicate with Google Clo
on <your_operating_system>_<your_cpu_architecture>
452
+
453
+
# Windows example
454
+
# Terraform v1.14.3
455
+
# on windows_amd64
456
+
457
+
# Linux example
458
+
# Terraform v1.14.3
459
+
# on linux_amd64
460
+
```
461
+
427
462
428
463
## Provisioning your Virtual Machine with Terraform
429
464
@@ -445,37 +480,54 @@ The specifications of the Virtual Machine and Network Settings you'll use for th
445
480
446
481
### Cost 💸
447
482
448
-
Creating and running a Virtual Machine on Google Cloud Platform costs money!
483
+
Creating and running a Virtual Machine on Google Cloud Platform costs money! 💸
449
484
450
485
If you have created a new Google Cloud Platform account, the cost of the Virtual machine will be covered by the $300 USD credit for the first 90 days if you are diligent with turning off your Virtual Machine (or finish the _Linux and Bash_ challenge today 😎).
451
486
452
487
❗ **The cost of running a Virtual Machine with our configuration 24 hours a day, 7 days a week is ~$150 USD per month.** ❗
453
488
454
-
You can massively reduce the cost by only running the Virtual Machine when you use it. You will _NOT_ be charged for the vCPU's and RAM while the Virtual Machine is off!
489
+
You can massively reduce the cost by only running the Virtual Machine when you use it. You will **NOT** be charged for the vCPU's and RAM while the Virtual Machine is off!
455
490
456
491
You will always pay for the Storage (equivalent of your hard-drive on your local computer). It's ~$10 USD per month for 100 GB.
457
492
458
-
The rule of thumb is: if Google can rent the resource out to someone else when your not using it, you only pay for it when you are using the resource. That's why you don't pay for the CPU and RAM when you are not using it, Google can rent it out to someone else, but always pay for Storage, Google can't rent it out to someone else because it has your data on it.
493
+
💡 A rule of thumb is: if a cloud provider can rent the resource out to someone else when your not using it, you only pay for it when you are using the resource. That's why you don't pay for the CPU and RAM when you are not using it, Google can rent it out to someone else - but will always pay for Storage, Google can't rent it out to someone else because it has your data on it.
459
494
460
495
### Download terraform files
461
496
462
497
We almost have all the necessary parts to create your VM using **terraform**. We need to download the terraform files and change a few values.
463
498
464
499
First we'll create a folder and download the terraform files with:
Your Virtual Machine should be up and running! Check the GCP Compute Engine console at this [link here](https://console.cloud.google.com/compute/instances) to confirm.
601
+
Your Virtual Machine should be up and running! Check the GCP Compute Engine console at this [link here 🔗](https://console.cloud.google.com/compute/instances) to confirm.
546
602
547
603
548
604
## Virtual Machine connection
@@ -592,8 +648,6 @@ And you are connected! It should look similar too:
592
648
593
649
Notice the connection in the very bottom-left corner of your VS Code window. It should have the Connection type (SSH), and the name of the host you are connected to.
594
650
595
-
**The setup of your local machine is over. All following commands will be run from within your 🚨 virtual machine**🚨 terminal (via VS Code)
596
-
597
651
<details>
598
652
<summarymarkdown='span'>Viewing your SSH Configuration</summary>
599
653
@@ -606,6 +660,12 @@ If you want to view your SSH configuration:
606
660
607
661
</details>
608
662
663
+
🚨🚨🚨 **The setup of your local machine is complete. All following terminal commands will be run from within your virtual machine terminal (via VS Code)** 🚨🚨🚨
664
+
665
+
---
666
+
667
+
# Part 2: Configure your Virtual Machine - Part 1
668
+
609
669
610
670
## VM gcloud and Application Default Credentials
611
671
@@ -676,7 +736,7 @@ ansible --version
676
736
You should get an output similar to (some version numbers might change, that's fine):
0 commit comments