wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

T6 # 276 - 332

Total questions: 55

Worksheet time: 55mins

Name
Class
Date
1.

Which of the below backends support state locking? three

a)

S3

b)

consul

c)

azurerm

d)

artifactory

2.

Which of the following value will be accepted for my_var?

1. variable "my_var"

2. {

3. type = string

4. }

a)

15

b)

"15"

c)

Both

d)

None of the above

3.

Select two answers to complete the following sentence: Before a new provider can be used, it must be ______ and _______.

a)

approved by HashiCorp

b)

uploaded to source control

c)

declared in the configuration

d)

initialized

4.

Given the Terraform configuration below, in which order will the resources be created?

a)

Larger image

b)

resources will be created simultaneously

c)

aws_eip will be created first aws_instance will be created second

d)

aws_instance will be created first aws_eip will be created second

Explanation:

5.

By default, where does Terraform store its state file?

a)

Amazon S3 bucket

b)

shared directory

c)

remotely using Terraform Cloud

d)

current working directory

6.

What are some of the features of Terraform state? (select three)

a)

inspection of cloud resources

b)

determining the correct order to destroy resources

c)

mapping configuration to real-world resources

d)

increased performance

7.

When configuring a remote backend in Terraform, it might be a good idea to purposely omit some of the required arguments to ensure secrets and other important data aren't inadvertently shared with others. What are the ways the remaining configuration can be added to Terraform so it can initialize and communicate with the backend? (select three)

a)

directly querying HashiCorp Vault for the secrets

b)

command-line key/value pairs

c)

use the -backend-config=PATH to specify a separate config file

d)

interactively on the command line

8.

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

a)

terraform inspect

b)

terraform read

c)

terraform show

d)

terraform state

9.

Select the answer below that completes the following statement: Terraform Cloud can be managed from the CLI but requires __________?

a)

an API token

b)

a TOTP token

c)

a username and password

d)

authentication using MFA

10.

What Terraform feature is shown in the example below?

a)

conditional expression

b)

local values

c)

dynamic block

d)

data source

11.

HashiCorp offers multiple versions of Terraform, including Terraform open-source, Terraform Cloud, and Terraform Enterprise. Which of the following Terraform features are only available in the Enterprise edition? (select three)

a)

SAML/SSO

b)

Sentinel

c)

Audit Logs

d)

Private Module Registry

e)

F. Private Network Connectivity

12.

What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code? (select three)

a)

Requests for infrastructure or hardware required a ticket, increasing the time required to deploy applications

b)

Traditional deployment methods are not able to meet the demands of the modern business where resources tend to live days to weeks, rather than months to years

c)

Traditionally managed infrastructure can't keep up with cyclic or elastic applications

d)

Pointing and clicking in a management console is a scalable approach and reduces human error as businesses are moving to a multi-cloud deployment model

13.

What is the best and easiest way for Terraform to read and write secrets from HashiCorp Vault?

a)

Vault provider

b)

API access using the AppRole auth method

c)

integration with a tool like Jenkins

d)

CLI access from the same machine running Terraform

14.

True or False: Workspaces provide identical functionality in the open-source, Terraform Cloud, and Enterprise versions of Terraform.

a)

True

b)

False

15.

True or False? terraform init cannot automatically download Community providers.

a)

True

b)

False

16.

Which of the following terraform subcommands could be used to remove the lock on the state for the current configuration?

a)

Unlock

b)

force-unlock

c)

Removing the lock on a state file is not possible

d)

state-unlock

17.

A user has created a module called "my_test_module" and committed it to GitHub. Over time, several commits have been made with updates to the module, each tagged in GitHub with an incremental version number. Which of the following lines would be required in a module configuration block in terraform to select tagged version v1.0.4?

a)

source = "git::https://example.com/my_test_module.git@tag=v1.0.4"

b)

source = "git::https://example.com/my_test_module.git&ref=v1.0.4"

c)

source = "git::https://example.com/my_test_module.git#tag=v1.0.4"

d)

source = "git::https://example.com/my_test_module.git?ref=v1.0.4"

18.

In the example below, the depends_on argument creates what type of dependency?

a)

implicit dependency

b)

internal dependency

c)

explicit dependency

d)

non-dependency resource

19.

What is the result of the following terraform function call?

a)

True

b)

False

20.

While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?

a)

JSON

b)

YAML

c)

TypeScript

d)

XML

21.

Select the operating systems which are supported for a clustered Terraform Enterprise: (select four)

a)

Unix

b)

Red Hat

c)

CentOS

d)

Amazon Linux

e)

Ubuntu

22.

In order to reduce the time it takes to provision resources, Terraform uses parallelism. By default, how many resources will Terraform provision concurrently?

a)

5

b)

50

c)

10

d)

20

23.

Provider dependencies are created in several different ways. Select the valid provider dependencies from the following list: (select three)

a)

Explicit use of a provider block in configuration, optionally including a version constraint.

b)

Use of any resource belonging to a particular provider in a resource or data block in configuration.

c)

Existence of any resource instance belonging to a particular provider in the current state.

d)

Existence of any provider plugins found locally in the working directory.

24.

The following is a snippet from a Terraform configuration file: Which, when validated, results in the following error: Fill in the blank in the error message with the correct string from the list below.

a)

version

b)

multi

c)

label

d)

alias

25.

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)

True

b)

False

26.

True or False? Each Terraform workspace uses its own state file to manage the infrastructure associated with that particular workspace.

a)

True

b)

False

27.

True or False? By default, Terraform destroy will prompt for confirmation before proceeding.

a)

True

b)

False

28.

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.

b)

Terraform is a mutable, declarative, Infrastructure as Code configuration management language based on Hashicorp Configuration Language, or optionally JSON.

c)

Terraform is an immutable, procedural, Infrastructure as Code configuration management language based on Hashicorp Configuration Language, or optionally JSON.

d)

Terraform is a mutable, procedural, Infrastructure as Code provisioning language based on Hashicorp Configuration Language, or optionally YAML.

29.

A user creates three workspaces from the command line - prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?

a)

terraform workspace dev

b)

terraform workspace select dev

c)

terraform workspace -switch dev

d)

terraform workspace switch dev

30.

Select all Operating Systems that Terraform is available for. (select five)

a)

Linux

b)

macOS

c)

Solaris

d)

Windows

e)

FreeBSD

31.

Which of the following commands will launch the Interactive console for Terraform interpolations?

a)

terraform console

b)

terraform cli

c)

terraform

d)

terraform cmdline

32.

During a terraform plan, a resource is successfully created but eventually fails during provisioning. What happens to the resource?

a)

Terraform attempts to provision the resource up to three times before exiting with an error

b)

the terraform plan is rolled back and all provisioned resources are removed

c)

it is automatically deleted

d)

the resource is marked as tainted

33.

Which of the following is not a valid Terraform string function?

a)

replace

b)

format

c)

join

d)

tostring

34.

Which of the following statements best describes the Terraform list(...) type?

a)

a collection of values where each is identified by a string label.

b)

a sequence of values identified by consecutive whole numbers starting with zero.

c)

a collection of unique values that do not have any secondary identifiers or ordering.

d)

a collection of named attributes that each have their own type.

35.

True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp tools provides the ability to mask secrets in the terraform plan and state files.

a)

True

b)

False

36.

Why might a user opt to include the following snippet in their configuration file?

a)

Terraform 0.12 introduced substantial changes to the syntax used to write Terraform configuration

b)

The user wants to ensure that the application being deployed is a minimum version of 0.12

c)

this ensures that all Terraform providers are above a certain version to match the application being deployed

d)

versions before Terraform 0.12 were not approved by HashiCorp to be used in production

37.

Anyone can publish and share modules on the Terraform Public Module Registry, and meeting the requirements for publishing a module is extremely easy. Select from the following list all valid requirements. (select three)

a)

The module must be PCI/HIPPA compliant.

b)

Module repositories must use this three-part name format, terraform--

c)

The registry uses tags to identify module versions

d)

Release tag names must be for the format x.y.z, and can optionally be prefixed with a v

e)

The module must be on GitHub and must be a public repo.

38.

A user runs terraform init on their RHEL based server and per the output, two provider plugins are downloaded: $ terraform init Initializing the backend... Initializing provider plugins...

- Checking for available provider plugins...

- Downloading plugin for provider "aws" (hashicorp/aws) 2.44.0...

- Downloading plugin for provider "random" (hashicorp/random) 2.2.1...

:

Terraform has been successfully initialized!

Where are these plugins downloaded to?

a)

The .terraform.plugins directory in the directory terraform init was executed in.

b)

The .terraform/plugins directory in the directory terraform init was executed in.

c)

/etc/terraform/plugins

d)

The .terraform.d directory in the directory terraform init was executed in.

39.

Which of the following is an invalid variable name?

a)

count

b)

web

c)

var1

d)

instance_name

40.

In the following code snippet, the block type is identified by which string?

a)

"aws_instance"

b)

resource

c)

db

d)

instance_type

41.

Which statements best describes what the local variable assignment is doing in the following code snippet:

a)

Create a distinct list of route table name objects

b)

Create a map of route table names to subnet names

c)

Create a map of route table names from a list of subnet names

d)

Create a list of route table names eliminating duplicates

42.

What is the result of the following terraform function call?

lookup({a="hello", b="goodbye"}, "c", "what?")

a)

hello

b)

what?

c)

goodbye

d)

c

43.

In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?

a)

Resource dependencies are identified and maintained in a file called resource.dependencies. Each terraform provider is required to maintain a list of all resource dependencies for the provider and it's included with the plugin during initialization when terraform init is executed. The file is located in the terraform.d folder.

b)

The terraform binary contains a built-in reference map of all defined Terraform resource dependencies. Updates to this dependency map are reflected in terraform versions. To ensure you are working with the latest resource dependency map you much be running the latest version of Terraform.

c)

Resource dependencies are handled automatically by the depends_on meta_argument, which is set to true by default.

d)

Terraform analyses any expressions within a resource block to find references to other objects, and treats those references as implicit ordering requirements when creating, updating, or destroying resources.

44.

From the code below, identify the implicit dependency:

a)

The EIP with an id of ami-2757f631

b)

The AMI used for the EC2 instance

c)

The EC2 instance labeled web_server

d)

The S3 bucket labeled company_data

45.

Terraform Cloud is more powerful when you integrate it with your version control system (VCS) provider. Select all the supported VCS providers from the answers below. (select four)

a)

GitHub

b)

CVS Version Control

c)

Azure DevOps Server

d)

Bitbucket Cloud

e)

GitHub Enterprise

46.

Terraform Enterprise (also referred to as pTFE) requires what type of backend database for a clustered deployment?

a)

PostgreSQL

b)

Cassandra

c)

MySQL

d)

MSSQL

47.

When Terraform needs to be installed in a location where it does not have internet access to download the installer and upgrades, the installation is generally known as to be __________.

a)

a private install

b)

disconnected

c)

air-gapped

d)

non-traditional

48.

When using providers that require the retrieval of data, such as the HashiCorp Vault provider, in what phase does Terraform actually retrieve the data required?

a)

terraform delete

b)

terraform plan

c)

terraform init

d)

terraform apply

49.

What feature of Terraform Cloud and/or Terraform Enterprise can you publish and maintain a set of custom modules which can be used within your organization?

a)

Terraform registry

b)

custom VCS integration

c)

private module registry

d)

remote runs

50.

Where can Terraform not load a provider from?

a)

Plugins directory

b)

Provider plugin cache

c)

Official HashrCorp distribution on releases, hashicorp.com

d)

Source code

51.

Which argument(s) are required when declaring a Terraform variable?

a)

type

b)

default

c)

description

d)

All of the above

e)

None of the above

52.

terraform apply will fail if you have not run terraform plan first to update the plan output.

a)

True

b)

False

53.

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

a)

Local values

b)

Dynamic blocks

c)

Count arguments

d)

Collection functions

54.

Which of the following is not a benefit of adopting infrastructure as code?

a)

Automation

b)

Versioning

c)

Reusability of code

d)

Interpolation

55.

Which of the following statements about local modules is incorrect:

a)

Local modules are not cached by terraform init command

b)

Local modules are sourced from a directory on disk

c)

Local modules support versions

d)

All of the above (all statements above are incorrect

e)

None of the above (all statements above are correct)