Deck 1 Flashcards

1
Q

What does a Terraform backend do?

A

Gives Terraform somewhere to store the state file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are Terraform’s main supported backends?

A
Local
[Generic] Remote
S3
Artifactory
Consul
Kubernetes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the command to get the Terraform console open?

A

terraform console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you enable Terraform debugging?

A

Set the environment variable TF_DEBUG to one of Trace, Debug, Info, Warn or Error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which debug level is the most verbose?

A

Trace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a Terraform install that doesn’t have internet access generally known as?

A

Air gapped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the index function do?

A

Give you the position number for a value in a list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How would you find the index of “B” in a list “A, B, C”?

A

index([“a”, “b”, “c”], “b”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the lookup function do?

A

Find the value for a given key, or return a default value if it can’t be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you set a variable from the CLI, using an environment variable?

A

Export the variable with TF_VAR_ in front of it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When does Terraform’s Vault provider go and get its information from vault?

A

When Terraform Plan is run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How can you access the output of one module from another?

A

Add an output from the first module, and retrieve the output in the second module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you remove the lock on a state for your current configuration?

A

terraform force-unlock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where are plugins stored by default?

A

.terraform/providers, in the current working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the general variable types?

A

String
Number
Boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the complex variable types?

A

Lists/tuples

Maps/objects

17
Q

What’s the format of a list variable, and what can it be used for?

A

list = [“a”, “b”, 15, true]

Note the quotes for string value types, but not boolean values

18
Q

What’s the format of a map variable?

A

Curly braces with a series of key:value pairs

{
name = “John”
age = 52
}

19
Q

When do variables need quotes, and which type?

A

Variables need double quotes when they are written strings.

Numbers, computed or referenced variables, or boolean values don’t need to be quoted.

20
Q

Is Terraform mutable or immutable? Why?

A

Mutable, because its objects can be changed after being created

21
Q

What OSes can Terraform run on?

A
Solaris
FreeBSD
macOS
Linux
Windows