Desk 2 Flashcards

1
Q

What is the command format to save a Terraform plan output to a file called lewis?

A

terraform plan -out=lewis

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

What are some of the features/functions of Terraform state?

A

Increased performance
Mapping configuration to real-world resources
Determining the correct order to destroy resources

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

Which Terraform feature would you use to iterate over a set of items, avoiding having to write code for each item explicitly?

A

A dynamic block

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

Terraform’s workspaces are the same in OSS and Cloud, true or false?

A

False.

A workspace in Cloud is like a whole new working directory, whereas in OSS it’s simply a different state file.

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

What does the ~> version constraint mean when pinning versions?

A

Only the rightmost version component is allowed to increase.

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

Which configuration line would you use to identify the version of a provider required?

A

required_providers

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

Which files should you set Git to ignore when commiting your code to a repo?

A

terraform.tfvars
terraform.tfstate
.terraform [Lewis added]

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

Which Terraform command can be used to inspect the current state file?

A

terraform show

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

What does the local-exec provisioner do?

A

Allows you to execute commands on the machine running Terraform, and to invoke a local executable.

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

How would you choose a specific module tag (in Git) as a source?

A

In a module block, add the source argument with “git::”, the Git URL and the tag, in the form “?ref=v1.0.4”, where v1.0.4 is the version tagged version.

Example:
module “vpc” {
source = “git::https://example.com/vpc.git?ref=v1.2.0”
}

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