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
Copy file name to clipboardExpand all lines: README.md
+34-5Lines changed: 34 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2359,6 +2359,12 @@ The benefits of Terraform over the other tools:
2359
2359
2360
2360
<details>
2361
2361
<summary>Explain what is "Terraform configuration"</summary><br><b>
2362
+
A configuration is a root module along with a tree of child modules that are called as dependencies from the root module.
2363
+
</b></details>
2364
+
2365
+
<details>
2366
+
<summary>What is HCL?</summary><br><b>
2367
+
HCL stands for Hashicorp Conviguration Language. It is the language Hashicorp made to use as the configuration language for a number of its tools, including terraform.
2362
2368
</b></details>
2363
2369
2364
2370
<details>
@@ -2390,6 +2396,7 @@ It keeps track of the IDs of created resources so that Terraform knows what it i
2390
2396
2391
2397
<code>terraform init</code> scans your code to figure which providers are you using and download them.
2392
2398
<code>terraform plan</code> will let you see what terraform is about to do before actually doing it.
2399
+
<code>terraform validate</code> checks if configuration is syntactically valid and internally consistent within a directory.
2393
2400
<code>terraform apply</code> will provision the resources specified in the .tf files.
2394
2401
</b></details>
2395
2402
@@ -2424,18 +2431,29 @@ It's a resource which was successfully created but failed during provisioning. T
2424
2431
<details>
2425
2432
<summary>What types of variables are supported in Terraform?</summary><br><b>
2426
2433
2427
-
String
2428
-
Integer
2429
-
Map
2430
-
List
2434
+
string
2435
+
number
2436
+
bool
2437
+
list(<TYPE>)
2438
+
set(<TYPE>)
2439
+
map(<TYPE>)
2440
+
object({<ATTR_NAME> = <TYPE>, ... })
2441
+
tuple([<TYPE>, ...])
2431
2442
</b></details>
2432
2443
2433
2444
<details>
2434
2445
<summary>What is a data source? In what scenarios for example would need to use it?</summary><br><b>
2446
+
Data sources lookup or compute values that can be used elsewhere in terraform configuration.
2447
+
2448
+
There are quite a few cases you might need to use them:
2449
+
* you want to reference resources not managed through terraform
2450
+
* you want to reference resources managed by a different terraform module
2451
+
* you want to cleanly compute a value with typechecking, such as with <code>aws_iam_policy_document</code>
2435
2452
</b></details>
2436
2453
2437
2454
<details>
2438
2455
<summary>What are output variables and what <code>terraform output</code> does?</summary><br><b>
2456
+
Output variables are named values that are sourced from the attributes of a module. They are stored in terraform state, and can be used by other modules through <code>remote_state</code>
2439
2457
</b></details>
2440
2458
2441
2459
<details>
@@ -2462,7 +2480,7 @@ List
2462
2480
2463
2481
<details>
2464
2482
<summary>Explain "State Locking"</summary><br><b>
2465
-
State locking is a mechanism that blocks an operations against a specific state file from multiple callers so as to avoid conflicting operations from different team members. Once the first caller's operation's lock is released the other team member may go ahead to
2483
+
State locking is a mechanism that blocks an operations against a specific state file from multiple callers so as to avoid conflicting operations from different team members. Once the first caller's operation's lock is released the other team member may go ahead to
2466
2484
carryout his own operation. Nevertheless Terraform will first check the state file to see if the desired resource already exist and
2467
2485
if not it goes ahead to create it.
2468
2486
</b></details>
@@ -2472,6 +2490,17 @@ List
2472
2490
The random provider aids in generating numeric or alphabetic characters to use as a prefix or suffix for a desired named identifier.
2473
2491
</b></details>
2474
2492
2493
+
<details>
2494
+
<summary>How do you test a terraform module?</summary><br><b>
2495
+
Many examples are acceptable, but the most common answer would likely to be using the tool <code>terratest</code>, and to test that a module can be initialized, can create resources, and can destroy those resources cleanly.
2496
+
</b></details>
2497
+
2498
+
<details>
2499
+
<summary>Aside from <code>.tfvars</code> files or CLI arguments, how can you inject dependencies from other modules?</summary><br><b>
2500
+
The built-in terraform way would be to use <code>remote-state</code> to lookup the outputs from other modules.
2501
+
It is also common in the community to use a tool called <code>terragrunt</code> to explicitly inject variables between modules.
0 commit comments