Skip to content

Commit fe9ca67

Browse files
authored
+ troubleshooting.md
1 parent e4d506f commit fe9ca67

File tree

1 file changed

+189
-0
lines changed

1 file changed

+189
-0
lines changed
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Troubleshooting: Known Errors
2+
3+
Costa Rica
4+
5+
[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/)
6+
[brown9804](https://github.com/brown9804)
7+
8+
Last updated: 2025-04-21
9+
10+
------------------------------------------
11+
12+
## Content
13+
14+
- [Terraform is not recognized](#terraform-is-not-recognized)
15+
- [Step 1: Download Terraform](#step-1-download-terraform)
16+
- [Step 2: Install Terraform](#step-2-install-terraform)
17+
- [For Windows:](#for-windows)
18+
- [For macOS:](#for-macos)
19+
- [For Linux:](#for-linux)
20+
- [Step 3: Verify the Installation](#step-3-verify-the-installation)
21+
- [Step 4: Initialize Terraform](#step-4-initialize-terraform)
22+
- [Resource Group Not Found](#resource-group-not-found)
23+
- [Resource Not Found](#resource-not-found)
24+
25+
## Terraform is not recognized
26+
27+
> Terraform is not recognized because it's not installed or not added to your system's PATH
28+
29+
```
30+
terraform : The term 'terraform' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
31+
spelling of the name, or if a path was included, verify that the path is correct and try again.
32+
At line:1 char:1
33+
+ terraform init
34+
+ ~~~~~~~~~
35+
+ CategoryInfo : ObjectNotFound: (terraform:String) [], CommandNotFoundException
36+
+ FullyQualifiedErrorId : CommandNotFoundException
37+
```
38+
39+
<p align="center">
40+
<img width="990" alt="image" src="https://github.com/user-attachments/assets/98076919-f13a-4461-aa34-55a8bff3d1fc" />
41+
</p>
42+
43+
### Step 1: Download Terraform
44+
45+
> By command line:
46+
47+
1. Open your command prompt.
48+
2. Use curl to download Terraform. Replace VERSION with the desired version number (e.g., 1.1.4):
49+
50+
```
51+
curl -o terraform.zip https://releases.hashicorp.com/terraform/VERSION/terraform_VERSION_windows_amd64.zip
52+
```
53+
54+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/473128f5-f146-4933-8b50-4afa59613810" />
55+
56+
3. Use tar to extract the ZIP file:
57+
58+
```
59+
tar -xvf terraform.zip
60+
```
61+
62+
<img width="316" alt="image" src="https://github.com/user-attachments/assets/c81fb71b-e30b-431e-8974-306ebca51418" />
63+
64+
> By GUI:
65+
66+
1. Go to the [Terraform download page](https://developer.hashicorp.com/terraform/install).
67+
2. Download the appropriate package for your operating system (e.g., Windows, macOS, Linux).
68+
69+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/58796ec5-9111-4d43-b5be-def40eab7922" />
70+
71+
### Step 2: Install Terraform
72+
73+
#### For Windows
74+
75+
1. Extract the downloaded ZIP file to a directory of your choice (e.g., `C:\terraform`).
76+
77+
<img width="479" alt="image" src="https://github.com/user-attachments/assets/a77f337f-d78d-4198-a838-bc802ef371f4" />
78+
79+
2. Add the directory to your system's PATH:
80+
81+
> By command line: <br/> `Assuming you have moved terraform.exe to C:\terraform, you can add this directory to the PATH using the following command`
82+
83+
```
84+
setx PATH "%PATH%;C:\terraform"
85+
```
86+
87+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/dd5fc584-e6b6-4922-a8cd-38a55afb99b1" />
88+
89+
> By GUI:
90+
- Open the Start menu and search for `Environment Variables`.
91+
- Click on `Edit the system environment variables`
92+
93+
<img width="550" alt="image" src="https://github.com/user-attachments/assets/495b8e1a-ca79-4103-b743-ed35ad190bec" />
94+
95+
- In the System Properties window, click on `Environment Variables`.
96+
97+
<img width="299" alt="image" src="https://github.com/user-attachments/assets/c5560100-5d3b-4461-a80d-eb1c1c2ede99" />
98+
99+
- Under `System variables`, find the `Path` variable and click `Edit`.
100+
- Click `New` and add the path to the directory where you extracted Terraform (e.g., `C:\terraform`).
101+
- Click `OK` to close all windows.
102+
103+
#### For macOS
104+
105+
1. Open a terminal.
106+
2. Move the Terraform binary to a directory included in your PATH (e.g., `/usr/local/bin`):
107+
108+
```sh
109+
sudo mv ~/Downloads/terraform /usr/local/bin/
110+
```
111+
112+
3. Ensure the directory is in your PATH by adding the following line to your `~/.bash_profile` or `~/.zshrc` file:
113+
114+
```sh
115+
export PATH=$PATH:/usr/local/bin
116+
```
117+
118+
4. Reload your profile:
119+
120+
```sh
121+
source ~/.bash_profile # or source ~/.zshrc
122+
```
123+
124+
#### For Linux
125+
126+
1. Open a terminal.
127+
2. Move the Terraform binary to a directory included in your PATH (e.g., `/usr/local/bin`):
128+
129+
```sh
130+
sudo mv ~/Downloads/terraform /usr/local/bin/
131+
```
132+
133+
3. Ensure the directory is in your PATH by adding the following line to your `~/.bashrc` or `~/.profile` file:
134+
135+
```sh
136+
export PATH=$PATH:/usr/local/bin
137+
```
138+
139+
4. Reload your profile:
140+
141+
```sh
142+
source ~/.bashrc # or source ~/.profile
143+
```
144+
145+
### Step 3: Verify the Installation
146+
147+
1. Open a new terminal or command prompt.
148+
2. Run the following command to verify the installation. You should see the installed version of Terraform.
149+
150+
```sh
151+
terraform -version
152+
```
153+
154+
### Step 4: Initialize Terraform
155+
156+
Now you can run the `terraform init` command in your project directory:
157+
158+
```sh
159+
terraform init
160+
```
161+
162+
## Resource Group Not Found
163+
164+
> Please ensure you create your resource group before running the configuration and deployment. This error occurs because the specified resource group does not exist.
165+
166+
```
167+
Error: Failed to get existing workspaces: Error retrieving keys for Storage Account "examplestorageacct": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceGroupNotFound" Message="Resource group 'RGWorkshopUserName' could not be found." but I want to create it
168+
```
169+
170+
<p align="center">
171+
<img width="990" alt="image" src="https://github.com/user-attachments/assets/14c0a4a1-4209-4c46-8a72-8132f6dbbcec" />
172+
</p>
173+
174+
## Resource Not Found
175+
176+
> Please ensure you create your storage account and container for backend before running the configuration and deployment. This error occurs because the specified storage account does not exist.
177+
178+
```
179+
Error: Failed to get existing workspaces: Error retrieving keys for Storage Account "examplestorageacct": storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/examplestorageacct' under resource group 'RGWorkshopUserName' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
180+
```
181+
182+
<p align="center">
183+
<img width="990" alt="image" src="https://github.com/user-attachments/assets/6c392d1e-32c5-4929-aaf7-6cdb853cf77d" />
184+
</p>
185+
186+
<div align="center">
187+
<h3 style="color: #4CAF50;">Total Visitors</h3>
188+
<img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/>
189+
</div>

0 commit comments

Comments
 (0)