Deck-1 Flashcards

1
Q

What are the features exclusive to Terraform Enterprise? Choose 2 correct answeres.

A

SAML SSO

Auto Logging

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

When writing Terraform code, HashiCorp recommends that you use how many spaces between each nesting level?

A

2 spaces

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

Default workspace cannot be deleted?

A

True

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

Why should you constrain the acceptable provider versions in Terraform configuration for production use?

Provide version constraints make sure only matching versions are cached under the plugin directory and remove other versions to optimized disk space usage.

A

Providers are plugins released on a separate rhythm from Terraform, so providers have their own version numbers, and version constraint ensures that new versions with breaking changes will not be automatically installed by terraform init in the future.

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

Medium Corp is making use of an open-source version of Terraform. You have created a number of reusable modules for various components that you want to share with your team.
What is the right approach to do that?

Terraform modules cannot be shared in the OSS version. Each developer needs to maintain its own modules and leverage them in the main tf file.

A

Upload your modules with proper versioning in the terraform module registry. Terraform OSS is directly integrated with the public module registry and can reference the modules from the code in the main tf file.

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

The terraform refresh command is used to reconcile the state Terraform knows via its _______
with the real-world infrastructure.

A

state file

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

Where does terraform store the data associated with the current state of your infrastructure when terraform plan is run?

A

state file

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

Which of the following will allow Matthew to stream the output of terraform plan that is running in Terraform Cloud locally?

A

Remote Backends

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

Which Terraform files should be ignored by Git when committing code to a repository? (Choose Three)

A

Files named exactly terraform.tfvars or terraform.tfvars.json
terraform.tfstate
Any files with names ending in .auto.tfvars or .auto.tfvars.json

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

Before a new provider can be used, it must be ______ and _______.

A

declared in the configuration.

initialized

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

The following snippet is from the Terraform 0.11 version. Which of the below is the equivalent 0.12 version code?
${var.instance_types}”

A

var.instance_types

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

When terraform refresh command is run, what are the operations that happen?

A

terraform refresh syncs the state file with the real world infrastructure.

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

What tasks are achieved while running a terrafom plan?

A

Create an execution plan by evaluatating the difference between the configuration file and state file.

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

Which of the following commands will implicitly not run terraform refresh?

A

terraform init

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

Which of the following variable declarations is going to result in an error?

A

Lists are defined with [ ] and maps are defined with { }.

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

When it comes to Terraform 0.12, what does the terraform init command do? Choose THREE correct answers.

A

1) Sees the root configuration directory for backend configuration, and initialized the chosen backend.
2) Searches for module blocks and the source code for referenced modules is retrieved from the locations given in their source arguments.
3) Searches the configuration for direct and indirect references to providers and load plugins distributed by Hashicorp.

17
Q

True or False. The terraform refresh command is used to reconcile the state
Terraform knows about (via its state file) with
the real-world infrastructure.
If drift is detected between the real-world
infrastructure and the last known-state, it will modify the
infrastructure to correct the drift.

A

False.

18
Q

Peter Griffin used Terraform to spin up a disposable environment for a product demo. The demo is complete now; hence he needs to destroy all the resources he created for this demo to avoid hourly charges. Since he also has few production instances on the same AWS account, he wants to review resources before deleting to be sure Terraform will not cause any unforeseen downtime. What are the options for doing that? Choose TWO correct answers.

A

terraform plan -destroy

terraform destroy

19
Q

Which flag would be used within a Terraform configuration block to identify the specific version of a provider required?

A

required_providers

20
Q

Modules sourced from local file paths support version meta-argument within module blocks.

A

false

21
Q

Terraform refresh is automatically run in which of the following commands? Select 2

A

terraform plan

terraform apply

22
Q

Select the most accurate statement to describe the Terraform language from the following list.

A

terraform is an immutable, declarative, infrastructure as code provisioning language based on Hashicorp Configuration Language or optionally JSON.

23
Q

Which of the following command is used to list all resources within a Terraform state?

A

terraform state list.

24
Q

Which among the following is the default backend for Terraform OSS?

A

local

25
Q

Which of the following action is not performed by terraform apply command?

A

import resource

26
Q

Which of the following terraform commands run refresh first, prior to any other work unless explicitly disabled? Choose THREE correct answers.

A

terraform destroy
terraform apply
terraform plan

27
Q

There can be multiple tfvars file were value associated with the variables that can be stored.
Which of the following files are loaded automatically without having to specify the -var-file option?

A

Any files with names ending with .auto.tfvars.json

terraform. tfvars
terraform. tfvars.json