HashiCorp Certified: Terraform Associate (003) Flashcards

1
Q

The terraform.tfstate file always matches your currently built infrastructure.
A. True
B. False

A

B

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

One remote backend configuration always maps to a single remote workspace.
A. True
B. False

A

A

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

How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?

A. It can execute Terraform runs on dedicated infrastructure on premises or in Terraform Cloud
B. It doesn’t show the output of a terraform apply locally
C. It is only available to paying customers
D. All of the above

A

A

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

What is the workflow for deploying new infrastructure with Terraform?

A. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.
B. Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.
C. terraform import to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.
D. Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.

A

D

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

A provider configuration block is required in every Terraform configuration.
Example:

A. True
B. False

A

A

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

You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script.
Which of the following commands would you use first?

A. terraform taint null_resource.run_script
B. terraform apply -target=null_resource.run_script
C. terraform validate null_resource.run_script
D. terraform plan -target=null_resource.run_script

A

A

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

Which provisioner invokes a process on the resource created by Terraform?
A. remote-exec
B. null-exec
C. local-exec
D. file

A

A

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

Which of the following is not true of Terraform providers?
A. Providers can be written by individuals
B. Providers can be maintained by a community of users
C. Some providers are maintained by HashiCorp
D. Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers
E. None of the above

A

D

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

What command does Terraform require the first time you run it within a configuration directory?
A. terraform import
B. terraform init
C. terraform plan
D. terraform workspace

A

B

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

You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code.
What is the best method to quickly find the IP address of the resource you deployed?

A. Run terraform output ip_address to view the result
B. In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
D. Run terraform destroy then terraform apply and look for the IP address in stdout

A

A

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

Which of the following is not a key principle of infrastructure as code?
A. Versioned infrastructure
B. Golden images
C. Idempotence
D. Self-describing infrastructure

A

A, B, D

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

Terraform variables and outputs that set the “description” argument will store that description in the state file.
A. True
B. False

A

A

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

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

A. Run terraform refresh
B. It will happen automatically
C. Manually update the state fire
D. Run terraform import

A

B

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

What is not processed when running a terraform refresh?
A. State file
B. Configuration file
C. Credentials
D. Cloud provider

A

C, D

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

What information does the public Terraform Module Registry automatically expose about published modules?

A. Required input variables
B. Optional inputs variables and default values
C. Outputs
D. All of the above
E. None of the above

A

E

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

If a module uses a local values, you can expose that value with a terraform output.
A. True
B. False

A

A

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

You should store secret data in the same version control repository as your Terraform configuration.
A. True
B. False

A

B

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

Which of the following is not a valid string function in Terraform?
A. split
B. join
C. slice
D. chomp

A

D

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

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with
Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)

A. Provision new VMs using Terraform with the same VM names
B. Use the terraform import command for the existing VMs
C. Write Terraform configuration for the existing VMs
D. Run the terraform import-gcp command

A

B, D

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

You have recently started a new job at a retailer as an engineer. As part of this new role, you have been tasked with evaluating multiple outages that occurred during peak shopping time during the holiday season. Your investigation found that the team is manually deploying new compute instances and configuring each compute instance manually. This has led to inconsistent configuration between each compute instance.
How would you solve this using infrastructure as code?

A. Implement a ticketing workflow that makes engineers submit a ticket before manually provisioning and configuring a resource
B. Implement a checklist that engineers can follow when configuring compute instances
C. Replace the compute instance type with a larger version to reduce the number of required deployments
D. Implement a provisioning pipeline that deploys infrastructure configurations committed to your version control system following code reviews

A

A

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

terraform init initializes a sample main.tf file in the current directory.
A. True
B. False

A

A

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

Which two steps are required to provision new infrastructure in the Terraform workflow? (Choose two.)
A. Destroy
B. Apply
C. Import
D. Init
E. Validate

A

B, D

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

Why would you use the terraform taint command?
A. When you want to force Terraform to destroy a resource on the next apply
B. When you want to force Terraform to destroy and recreate a resource on the next apply
C. When you want Terraform to ignore a resource on the next apply
D. When you want Terraform to destroy all the infrastructure in your workspace

A

B

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

Terraform requires the Go runtime as a prerequisite for installation.
A. True
B. False

A

B

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

When should you use the force-unlock command?
A. You see a status message that you cannot acquire the lock
B. You have a high priority change
C. Automatic unlocking failed
D. You apply failed due to a state lock

A

C

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

Terraform can import modules from a number of sources `” which of the following is not a valid source?
A. FTP server
B. GitHub repository
C. Local path
D. Terraform Module Registry

A

A

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

Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?
A. Secure variable storage
B. Support for multiple cloud providers
C. Dry runs with terraform plan
D. Using the workspace as a data source

A

A

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

terraform validate validates the syntax of Terraform files.
A. True
B. False

A

A

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

You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your
Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)

A. Run terraform plan -destroy.
B. This is not possible. You can only show resources that will be created.
C. Run terraform state rm *.
D. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.

A

C, D

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

Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?
A. servers = num_servers
B. servers = variable.num_servers
C. servers = var(num_servers)
D. servers = var.num_servers

A

A

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

A Terraform provisioner must be nested inside a resource configuration block.
A. True
B. False

A

A

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

Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.
A. True
B. False

A

B

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

What does the default “local” Terraform backend store?
A. tfplan files
B. Terraform binary
C. Provider plugins
D. State file

A

D

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

You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?

A. Run the terraform fmt command during the code linting phase of your CI/CD process
B. Designate one person in each team to review and format everyone’s code
C. Manually apply two spaces indentation and align equal sign “=” characters in every Terraform file (*.tf)
D. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed

A

C

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

What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?

A. The ability to share modules with public Terraform users and members of Terraform Enterprise Organizations
B. The ability to tag modules by version or release
C. The ability to restrict modules to members of Terraform Cloud or Enterprise organizations
D. The ability to share modules publicly with any user of Terraform

A

D

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

Which task does terraform init not perform?
A. Sources all providers present in the configuration and ensures they are downloaded and available locally
B. Connects to the backend
C. Sources any modules and copies the configuration locally
D. Validates all required variables are present

A

D

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

You have declared a variable called var.list which is a list of objects that all have an attribute id.
Which options will produce a list of the IDs? (Choose two.)
A. { for o in var.list : o => o.id }
B. var.list[].id
C. [ var.list[
].id ]
D. [ for o in var.list : o.id ]

A

A, B

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

Which argument(s) is (are) required when declaring a Terraform variable?
A. type
B. default
C. description
D. All of the above
E. None of the above

A

B

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

When using a module block to reference a module stored on the public Terraform Module Registry such as:

How do you specify version 1.0.0?
A. Modules stored on the public Terraform Module Registry do not support versioning
B. Append ?ref=v1.0.0 argument to the source path
C. Add version = “1.0.0” attribute to module block
D. Nothing ג€” modules stored on the public Terraform Module Registry always default to version 1.0.0

A

C

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

What features does the hosted service Terraform Cloud provide? (Choose two.)
A. Automated infrastructure deployment visualization
B. Automatic backups
C. Remote state storage
D. A web-based user interface (UI)

A

B, C

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

Where does the Terraform local backend store its state?
A. In the /tmp directory
B. In the terraform file
C. In the terraform.tfstate file
D. In the user’s terraform.state file

A

C

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

Which option can not be used to keep secrets out of Terraform configuration files?
A. A Terraform provider
B. Environment variables
C. A -var flag
D. secure string

A

C

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

What is one disadvantage of using dynamic blocks in Terraform?
A. They cannot be used to loop through a list of values
B. Dynamic blocks can construct repeatable nested blocks
C. They make configuration harder to read and understand
D. Terraform will run more slowly

A

A

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

Only the user that generated a plan may apply it.
A. True
B. False

A

B

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

Examine the following Terraform configuration, which uses the data source for an AWS AMI.
What value should you enter for the ami argument in the AWS instance resource?

A. aws_ami.ubuntu
B. data.aws_ami.ubuntu
C. data.aws_ami.ubuntu.id
D. aws_ami.ubuntu.id

A

C

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

You need to specify a dependency manually.
What resource meta-parameter can you use to make sure Terraform respects the dependency?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

A

FILL BLANK - depends_on

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

You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains
15 virtual machines (VM). You develop a Terraform configuration containing one VM, perform terraform apply, and see that your VM was created successfully.
What should you do to delete the newly-created VM with Terraform?

A. The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
B. The Terraform state file only contains the one new VM. Execute terraform destroy.
C. Delete the Terraform state file and execute Terraform apply.
D. Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.

A

B

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

What is the name assigned by Terraform to reference this resource?

A. dev
B. azurerm_resource_group
C. azurerm
D. test

A

A

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

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.
A. True
B. False

A

A

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

How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? (Choose two.)

A. A full audit trail of the request and fulfillment process is generated
B. A request must be submitted for infrastructure changes
C. As additional resources are required, more tickets are submitted
D. A catalog of approved resources can be accessed from drop down lists in a request form

A

B, C

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

You can reference a resource created with for_each using a Splat (*) expression.

A. True
B. False

A

B

Explanation:
Splat Expressions with Maps The splat expression patterns shown above apply only to lists, sets, and tuples. To get a similar result with a map or object value you must use for expressions. Resources that use the for_each argument will appear in expressions as a map of objects, so you can’t use splat expressions with those resources. For more information, see Referring to Resource Instances. https://www.terraform.io/language/meta-arguments/for_each#referring-to-instances

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

Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example git::https://example.com/vpc.git)?

A. Append ref=v1. 0. 0 argument to the source path
B. Add version = “1.0.0” parameter to module block
C. Nothing “ modules stored on GitHub always default to version 1.0.0
D. Modules stored on GitHub do not support versioning

A

A

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

What does terraform destroy do?

A. Destroy all infrastructure in the Terraform state file
B. Destroy all Terraform code files in the current directory while leaving the state file intact
C. Destroy all infrastructure in the configured Terraform provider
D. Destroy the Terraform state file while leaving infrastructure intact

A

A

Explanation:
The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by the current Terraform project.

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

You’re writing a Terraform configuration that needs to read input from a local file called id_rsa.pub. Which built-in Terraform function can you use to import the file’s contents as a string?

A. fileset(“id_rsa.pub”)
B. filebase64(“id_rsa.pub”)
C. templatefile(“id_rsa.pub”)
D. file(“id_rsa.pub”)

A

D

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

You need to migrate a workspace to use a remote backend. After updating your configuration, what command do you run to perform the migration?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

A. terraform init
B. terraform onit

A

A

Once you have authenticated to Terraform Cloud, you’re ready to migrate your local state file to Terraform Cloud. To begin the migration, reinitialize. This causes Terraform to recognize your cloud block configuration.

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

When should Terraform configuration files be written when running terraform import on existing infrastructure?

A. Infrastructure can be imported without corresponding Terraform code
B. Terraform will generate the corresponding configuration files for you
C. You should write Terraform configuration files after the next terraform import is executed
D. Terraform configuration should be written before terraform import is executed

A

D

Explanation:
The current implementation of Terraform import can only import resources into the state. It does not generate configuration. A future version of Terraform will also generate configuration. Because of this, prior to running terraform import it is necessary to write manually a resource configuration block for the resource, to which the imported object will be mapped.

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

A Terraform backend determines how Terraform loads state and stores updates when you execute.

A. apply
B. taint
C. destroy
D. All of the above
E. None of the above

A

D

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

What does Terraform use .terraform.lock.hcl file for?

A. Tracking provider dependencies
B. There is no such file
C. Preventing Terraform runs from occurring
D. Storing references to workspaces which are locked

A

A

Explanation:
“hcl , and this name is intended to signify that it is a lock file for various items that Terraform caches in the . terraform subdirectory of your working directory. Terraform automatically creates or updates the dependency lock file each time you run the terraform init command.”

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

A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?

A. Build a completely brand new set of infrastructure
B. Tear down the entire workspace infrastructure and rebuild it
C. Rebuild only the instances that were deleted
D. Stop and generate an error message about the missing instances

A

C

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

Which are forbidden actions when the Terraform state file is locked? (Choose three.)

A. terraform destroy
B. terraform fmt
C. terraform state list
D. terraform apply
E. terraform plan
F. terraform validate

A

A, D, E

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

How would you reference the Volume IDs associated with the ebs_block_device blocks in this configuration?

A. aws_instance.example.ebs_block_device.[].volume_id
B. aws_instance.example.ebs_block_device.volume_id
C. aws_instance.example.ebs_block_device[sda2,sda3].volume_id
D. aws_instance.example.ebs_block_device.
.volume_id

A

A

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

In the below configuration, how would you reference the module output vpc_id?
Type your answer in the field provided. The text field is not case sensitive and all variations of the correct answer are accepted.

A. module.vpc.vpc_id
B. module.vpc.cpc_id

A

A

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

Which are examples of infrastructure as code? (Choose two.)

A. Cloned virtual machine images
B. Change management database records
C. Versioned configuration files
D. Docker files

A

C, D

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

You cannot install third party plugins using terraform init.

A. True
B. False

A

B

Explanation:
For providers that are published in either the public Terraform Registry or in a third-party provider registry, terraform init will automatically find, download, and install the necessary provider plugins.

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

Which command lets you experiment with Terraform’s built-in functions?

A. terraform env
B. terraform console
C. terraform test
D. terraform validate

A

B

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

Terraform console provides an interactive command-line console for evaluating and experimenting with expressions. You can use it to test interpolations before using them in configurations and to interact with any values currently saved in state.
Which configuration consistency errors does terraform validate report?

A. A mix of spaces and tabs in configuration files
B. Differences between local and remote state
C. Terraform module isn’t the latest version
D. Declaring a resource identifier more than once

A

D

Explanation:
validate will look for syntax errors “Declaring a resource identifier more than once” is a syntax error

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

Which of the following Terraform commands is used to initialize a Terraform working directory?

a) terraform validate
b) terraform plan
c) terraform init
d) terraform apply

A

C

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

What is Terraform?

a) A configuration management tool
b) A cloud orchestration tool
c) A programming language
d) An infrastructure as code tool

A

D

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

What is the purpose of the Terraform State?

a) To store the current state of infrastructure resources
b) To store the configuration code written in Terraform
c) To track the version control of Terraform modules
d) To manage user authentication and access control

A

A

70
Q

What is HCL (HashiCorp Configuration Language)?

a) A domain-specific language for defining infrastructure resources
b) A scripting language used to automate Terraform workflows
c) A markup language for creating user interfaces
d) A command-line interface for managing Terraform resources

A

A

71
Q

Which of the following is the correct syntax for defining a variable in Terraform?

a) variable “name” { default = “value” }
b) var name = “value”
c) input name = “value”
d) var “name” = “value”

A

A

72
Q

What is the purpose of Terraform Data Sources?

a) To define variables used in Terraform configuration
b) To specify the version constraints for Terraform modules
c) To import existing infrastructure resources into Terraform
d) To create dynamic outputs based on Terraform configurations

A

C

73
Q

Which of the following Terraform commands is used to create an execution plan?

a) terraform validate
b) terraform init
c) terraform plan
d) terraform apply

A

C

74
Q

What is the purpose of the -target flag in the terraform apply command?

a) To specify the target directory for the Terraform state file
b) To specify the target AWS region for resource provisioning
c) To limit the operation to a specific resource or module
d) To enable verbose output for debugging purposes

A

C

75
Q

Which of the following Terraform commands is used to destroy the infrastructure created by Terraform?

a) terraform destroy
b) terraform stop
c) terraform teardown
d) terraform remove

A

A

76
Q

What is a Terraform Provider?

a) A tool for testing Terraform configurations
b) A cloud service that manages Terraform resources
c) A plugin that manages resources for a specific infrastructure platform
d) A security mechanism for restricting Terraform access

A

C

77
Q

How can you manage resource dependencies in Terraform?

a) By using the depends_on argument within resource blocks
b) By defining resource dependencies in the Terraform State file
c) By specifying dependencies in the provider configuration
d) By using conditional statements in the Terraform configuration code

A

A

78
Q

What is Terraform Remote State?

a) A remote repository for storing Terraform configuration files
b) A secure storage location for sensitive Terraform data
c) A distributed version control system for Terraform code
d) A centralized store for storing the Terraform State file

A

D

79
Q

What is a Terraform Module?

a) A collection of Terraform resources that are managed together
b) A script for automating Terraform workflow tasks
c) A configuration file for defining variables and outputs
d) A template for creating custom Terraform providers

A

A

80
Q

How can you pass variables to a Terraform Module?

a) By using environment variables
b) By specifying variables in the Terraform State file
c) By using the -var command-line option when running Terraform commands
d) By defining variables in the module’s configuration file

A

C

81
Q

What is the purpose of the output block in a Terraform Module?

a) To define variables used within the module
b) To specify the module’s dependencies
c) To expose values from the module to be used by other configurations
d) To store sensitive data securely within the module

A

C

82
Q

What is a Terraform Workspace?

a) A virtual environment for isolating Terraform configurations
b) A collaboration tool for multiple Terraform developers
c) A web-based interface for managing Terraform resources
d) A version control system for Terraform configurations

A

A

83
Q

How can you create a new Terraform Workspace?

a) By using the terraform workspace create command
b) By specifying the workspace name in the Terraform configuration file
c) By running the terraform init command with the -workspace flag
d) By using the terraform workspace new command

A

A

84
Q

What is the purpose of the default workspace in Terraform?

a) It is the initial workspace created when running terraform init
b) It is a reserved workspace that cannot be modified or deleted
c) It is the default workspace used when no other workspace is specified
d) It is a workspace specifically designed for storing Terraform State

A

C

85
Q

How can you authenticate with a Terraform Provider?

a) By specifying authentication credentials in the Terraform configuration file
b) By using environment variables to store authentication information
c) By passing authentication details via command-line options when running Terraform commands
d) By configuring authentication within the provider’s specific configuration block

A

D

86
Q

What is the purpose of the terraform.tfstate.backup file?

a) It is a backup file for storing previous versions of the Terraform State file
b) It is a cache file used to improve Terraform performance
c) It is a log file that records changes made to the Terraform State
d) It is a temporary file used during the execution of Terraform commands

A

A

87
Q

How can you manage multiple Terraform Provider versions in a configuration?

a) By using the terraform version command to switch between provider versions
b) By specifying provider versions in the required_providers block of the Terraform configuration
c) By creating separate Terraform modules for each provider version
d) By using environment variables to set the desired provider version

A

B

88
Q

What is Terraform?

a) A configuration management tool
b) A cloud orchestration tool
c) A programming language
d) An infrastructure as code tool

A

D

89
Q

What is the purpose of the Terraform State?

a) To store the current state of infrastructure resources
b) To store the configuration code written in Terraform
c) To track the version control of Terraform modules
d) To manage user authentication and access control

A

A

90
Q

Which of the following Terraform commands is used to initialize a Terraform working directory?

a) terraform validate
b) terraform plan
c) terraform init
d) terraform apply

A

C

91
Q

Which of the following is the correct syntax for defining a variable in Terraform?

a) variable “name” { default = “value” }
b) var name = “value”
c) input name = “value”
d) var “name” = “value”

A

A

92
Q

What is the purpose of Terraform Data Sources?

a) To define variables used in Terraform configuration
b) To specify the version constraints for Terraform modules
c) To import existing infrastructure resources into Terraform
d) To create dynamic outputs based on Terraform configurations

A

C

93
Q

Which of the following Terraform commands is used to create an execution plan?

a) terraform validate
b) terraform init
c) terraform plan
d) terraform apply

A

C

94
Q

What is the purpose of the -target flag in the terraform apply command?

a) To specify the target directory for the Terraform state file
b) To specify the target AWS region for resource provisioning
c) To limit the operation to a specific resource or module
d) To enable verbose output for debugging purposes

A

C

95
Q

Which of the following Terraform commands is used to destroy the infrastructure created by Terraform?

a) terraform destroy
b) terraform stop
c) terraform teardown
d) terraform remove

A

A

96
Q

What is a Terraform Provider?

a) A tool for testing Terraform configurations
b) A cloud service that manages Terraform resources
c) A plugin that manages resources for a specific infrastructure platform
d) A security mechanism for restricting Terraform access

A

C

97
Q

How can you manage resource dependencies in Terraform?

a) By using the depends_on argument within resource blocks
b) By defining resource dependencies in the Terraform State file
c) By specifying dependencies in the provider configuration
d) By using conditional statements in the Terraform configuration code

A

A

98
Q

What is Terraform Remote State?

a) A remote repository for storing Terraform configuration files
b) A secure storage location for sensitive Terraform data
c) A distributed version control system for Terraform code
d) A centralized store for storing the Terraform State file

A

D

99
Q

What is a Terraform Module?

a) A collection of Terraform resources that are managed together
b) A script for automating Terraform workflow tasks
c) A configuration file for defining variables and outputs
d) A template for creating custom Terraform providers

A

A

100
Q

How can you pass variables to a Terraform Module?

a) By using environment variables
b) By specifying variables in the Terraform State file
c) By using the -var command-line option when running Terraform commands
d) By defining variables in the module’s configuration file

A

C

101
Q

What is the purpose of the output block in a Terraform Module?

a) To define variables used within the module
b) To specify the module’s dependencies
c) To expose values from the module to be used by other configurations
d) To store sensitive data securely within the module

A

C

102
Q

What is Infrastructure as Code (IaC)?

a) The practice of manually provisioning infrastructure resources
b) A method for defining and managing infrastructure resources through code
c) A process for automating network configurations
d) A framework for creating virtualized environments

A

B

103
Q

Which of the following resources is managed by Terraform?

a) Virtual machines
b) Cloud storage buckets
c) Database instances
d) All of the above

A

D

104
Q

What is the purpose of Terraform’s plan phase?

a) To create infrastructure resources
b) To update the Terraform state file
c) To validate the Terraform configuration
d) To preview the changes to be made in infrastructure

A

D

105
Q

Which of the following variable types can be defined in Terraform?

a) String
b) Number
c) List
d) All of the above

A

D

106
Q

What is the purpose of the terraform.tfvars file?

a) It stores sensitive information used in Terraform configurations.
b) It defines variables and their values for a Terraform module.
c) It specifies the version of Terraform to be used in the project.
d) It is not a valid file in Terraform configurations.

A

B

107
Q

Which of the following Terraform commands applies the changes to infrastructure?

a) terraform apply
b) terraform validate
c) terraform plan
d) terraform refresh

A

A

108
Q

How does Terraform manage resource dependencies?

a) By automatically resolving dependencies based on the order of resource creation.
b) By using the depends_on argument within resource blocks.
c) By defining dependencies in the required_providers block of the configuration.
d) By using the terraform.tfstate file to track and resolve dependencies.

A

B

109
Q

What is the purpose of the Terraform State file?

a) To store the Terraform configuration code.
b) To track changes to infrastructure resources.
c) To store provider-specific configuration details.
d) To manage Terraform workspace information.

A

B

110
Q

Which of the following commands is used to manage Terraform workspaces?

a) terraform import
b) terraform workspace
c) terraform state
d) terraform output

A

B

111
Q

What is Terraform Provisioning?

a) The process of configuring infrastructure resources using Terraform.
b) The process of managing software packages on virtual machines.
c) The process of allocating IP addresses for networking resources.
d) The process of scaling infrastructure resources based on demand.

A

A

112
Q

How can you specify conditional creation of resources in Terraform?

a) By using the if statement in Terraform configuration code.
b) By defining conditional statements within resource blocks.
c) By using the count parameter in resource blocks.
d) By creating separate Terraform modules for different conditions.

A

C

113
Q

What is a Terraform Provider Plugin?

a) A software package that extends Terraform with additional functionality.
b) A mechanism for authenticating Terraform with cloud providers.
c) A containerized environment for running Terraform configurations.
d) A web-based interface for managing Terraform resources.

A

A

114
Q

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

A

B

115
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.
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.

A

A

Explanation:
Terraform is not a configuration management tool - https://www.terraform.io/intro/vs/chefpuppet.html
Terraform is a declarative language - https://www.terraform.io/docs/configuration/index.html Terraform supports a syntax that is JSON compatible - https://www.terraform.io/docs/configuration/syntax-json.html
Terraform is primarily designed on immutable infrastructure principles

116
Q

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

A. False
B. True

A

B

117
Q

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

A. False
B. True

A

B

Explanation:
Reference:
The persistent data stored in the backend belongs to a workspace. Initially, the backend has only one workspace, called “default”, and thus there is only one Terraform state associated with that configuration.

118
Q

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
B. True

A

A

119
Q

Complete the following sentence:
The terraform state command can be used to

A. modify state
B. view state
C. refresh state
D. There is no such command

A

A

120
Q

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.

A

A, B, C

Explanation:
The existence of a provider plugin found locally in the working directory does not itself create a provider dependency. The plugin can exist without any reference to it in the terraform configuration.

121
Q

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

A

C

122
Q

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

A

B, C, D, E

123
Q

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

A

A

Explanation:
The constructs in the Terraform language can also be expressed in JSON syntax, which is harder for humans to read and edit but easier to generate and parse programmatically.

124
Q

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

A. Linux
B. mac OS
C. Unix
D. Solaris
E. Windows
F. FreeBSD

A

A, B, D, E, F

125
Q

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”

A

D

126
Q

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

A

B

127
Q

terraform init cannot automatically download Community providers.

A. False
B. True

A

B

128
Q

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

A. True
B. False

A

B

129
Q

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

A

A

130
Q

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

A

A, B, C

Explanation:
Businesses are making a transition where traditionally-managed infrastructure can no longer meet the demands of today’s businesses. IT organizations are quickly adopting the public cloud, which is predominantly API-driven. To meet customer demands and save costs, application teams are architecting their applications to support a much higher level of elasticity, supporting technology like containers and public cloud resources. These resources may only live for a matter of hours; therefore the traditional method of raising a ticket to request resources is no longer a viable option Pointing and clicking in a management console is NOT scale and increases the change of human error.

131
Q

What are the benefits of using Infrastructure as Code? (select five)

A. Infrastructure as Code is relatively simple to learn and write, regardless of a user’s prior experience with developing code
B. Infrastructure as Code provides configuration consistency and standardization among deployments
C. Infrastructure as Code is easily repeatable, allowing the user to reuse code to deploy similar, yet different resources
D. Infrastructure as Code gives the user the ability to recreate an application’s infrastructure for disaster recovery scenarios
E. Infrastructure as Code easily replaces development languages such as Go and .Net for application development
F. Infrastructure as Code allows a user to turn a manual task into a simple, automated deployment (Correct)

A

A, C, D, F

Explanation:
If you are new to infrastructure as code as a concept, it is the process of managing infrastructure in a file or files rather than manually configuring resources in a user interface.
A resource in this instance is any piece of infrastructure in a given environment, such as a virtual machine, security group, network interface, etc. At a high level, Terraform allows operators to use HCL to author files containing definitions of their desired resources on almost any provider (AWS, GCP, GitHub, Docker, etc) and automates the creation of those resources at the time of application.

132
Q

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?

A. SAML/SSO
B. Sentinel
C. Audit Logs
D. Clustering
E. Private Module Registry
F. Private Network Connectivity

A

A, C, F

133
Q

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

A

A

Explanation:
API and CLI access are managed with API tokens, which can be generated in the Terraform Cloud UI. Each user can generate any number of personal API tokens, which allow access with their own identity and permissions. Organizations and teams can also generate tokens for automating tasks that aren’t tied to an individual user.

134
Q

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

A

B, C, D

Explanation:
You do not need to specify every required argument in the backend configuration. Omitting certain arguments may be desirable to avoid storing secrets, such as access keys, within the main configuration. When some or all of the arguments are omitted, we call this a partial configuration. With a partial configuration, the remaining configuration arguments must be provided as part of the initialization process. There are several ways to supply the remaining arguments

135
Q

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

A. terraform console
B. terraform cli
C. terraform
D. terraform cmdline

A

B

136
Q

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

A. replace
B. format
C. join
D. tostring

A

D

137
Q

What is a key benefit of the Terraform state file?

A. A state file represents a source of truth for resources provisioned with a public cloud console
B. A state file represents a source of truth for resources provisioned with Terraform
C. A state file represents the desired state expressed by the Terraform code files
D. A state file can be used to schedule recurring infrastructure tasks

A

C

138
Q

When you use a remote backend that needs authentication. HashrCorp recommends that you:

A. Push your Tefraform configuration to an encrypted git repository
B. Write the authentication credentials in the Terraform configuration files
C. Use partial configuration to load the authentication credentials outside of the Terraform code
D. Keep the Terraform configuration files in a secret store

A

C

Explanation:
We recommend omitting the token from the configuration, and instead using terraform login or manually configuring credentials in the CLI config file.

139
Q

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)

A

C

Explanation:
Version constraints are supported only for modules installed from a module registry, such as the public Terraform Registry or Terraform Cloud’s private module registry. Other module sources can provide their own versioning mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced from local file paths do not support version; since they’re loaded from the same source repository, they always share the same version as their caller

140
Q

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

A. Automation
B. Versioning
C. Reusability of code
D. Interpolation

A

D

141
Q

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

A

B

142
Q

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

A. True
B. False

A

B

143
Q

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

A

E

Explanation:
Terraform CLI defines the following OPTIONAL arguments for variable declarations:
default - A default value which then makes the variable optional.
type - This argument specifies what value types are accepted for the variable. description - This specifies the input variable’s documentation.
validation - A block to define validation rules, usually in addition to type constraints. sensitive - Limits Terraform UI output when the variable is used in configuration. nullable - Specify if the variable can be null within the module.

144
Q

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

A

D

145
Q

The terraform.tfstate file always matches your currently built infrastructure.
A. True
B. False

A

B

https://www.terraform.io/docs/language/state/index.html

146
Q

When do you need to explicitly execute terraform refresh?

A. Before every terraform plan
B. Before every terraform apply
C. Before every terraform import
D. None of the above

A

D

Wherever possible, avoid using terraform refresh explicitly and instead rely on Terraform’s behavior of automatically refreshing existing objects as part of creating a normal plan. Source: https://www.terraform.io/cli/commands/refresh

147
Q

How does Terraform determine dependencies between resources?

A. Terraform automatically builds a resource graph based on resources, provisioners, special meta-parameters, and the state file, if present.
B. Terraform requires all dependencies between resources to be specified using the depends_on parameter
C. Terraform requires resources in a configuration to be listed in the order they will be created to determine dependencies
D. Terraform requires resource dependencies to be defined as modules and sourced in order

A

A

https://learn.hashicorp.com/tutorials/terraform/dependencies

148
Q

What does terraform refresh modify?

A. Your cloud infrastructure
B. Your state file
C. Your Terraform plan
D. Your Terraform configuration

A

B

The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match. Source: https://www.terraform.io/cli/commands/refresh

149
Q

Which of the following is not a valid source path for specifying a module?

A. source = “./modulelversion=v1.0.0”
B. source = “github.com/hashicorp/example?ref=v1.0.0”
C. source = “./module”
D. source = “hashicorp/consul/aws”

A

A

150
Q

Do terraform workspaces help in adding/allowing multiple state files for a single configuration?

A. True
B. False

A

A

151
Q

Which of the following is not supported by backend types in Terraform?

A. consul
B. gcs
C. manta
D. bitbucket

A

D

152
Q

Which Terraform collection type should you use to store key/value pairs?

A. set
B. tuple
C. list
D. map

A

D

153
Q

Which of the following can you do with terraform plan? Choose two correct answers.

A. View the execution plan and check if the changes match your expectations
B. Schedule Terraform to run at a planned time in the future
C. Execute a plan in a different workspace
D. Save a generated execution plan to apply later

A

A , D

https://learn.hashicorp.com/tutorials/terraform/plan

154
Q

How would you reference the attribute “name* of this fictitious resource in HCL?

A. resource.kubrnetes_namespace>example.name
B. kubernetes_namespace.test.name
C. kubernetes_namespace.example,name
D. data kubernetes_namespace.name
E. None of the above

A

C

https://www.terraform.io/language/expressions/references#references-to-resource-attributes

155
Q

You have modified your Terraform configuration to fix a typo in the Terraform ID of a resource from aws_security_group.http to aws_security_group.http

Which of the following commands would you run to update the ID in state without destroying the resource?

A. terraform refresh
B. terraform apply
C. terraform mv aws-security-group.htp aws-security-group.http

A

C

The terraform state mv command changes which resource address in your configuration is associated with a particular real-world object. Use this to preserve an object when renaming a resource, or when moving a resource into or out of a child module.

156
Q

All modules published on the official Terraform Module Registry have been verified by HashiCorp.

A. True
B. False

A

B

Explanation:
https://registry.terraform.io/
Only modules considered “Verified Modules” are reviewed by Hashicorp, otherwise anyone can publish modules on the Terraform Registry.

Reference:
https://www.terraform.io/registry/modules/verified https://www.terraform.io/registry/modules/publish

157
Q

You want to share Terraform state with your team, store it securely and provide state locking. How would you do this? Choose three correct answers.

A. Using the consul Terraform backend.
B. Using the remote Terraform backend with Terraform Cloud /
Terraform Enterprise.
C. Using the local backend.
D. Using the s3 terraform backend. The dynamodb_field option e not needed.
E. Using an s3 terraform backend with an appropriate IAM policy and dynamodb_field option configured.

A

A, B, E

158
Q

terraform validate validates that your infrastructure matches the Terraform state file.

A. True
B. False

A

B

Explanation:
The terraform validate command validates the configuration files in a directory, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc.
Validate runs checks that verify whether a configuration is syntactically valid and internally consistent, regardless of any provided variables or existing state. It is thus primarily useful for general verification of reusable modules, including correctness of attribute names and value types. Source: https://www.terraform.io/cli/commands/validate

159
Q

When does Sentinel enforce policy logic during a Terraform Enterprise run?

A. Before the plan phase
B. During the plan phase
C. Before the a apply phase
D. After the apply phase

A

C

Explanation:
“Enforcing policy checks on runs - Policies are checked when a run is performed, after the terraform plan but before it can be confirmed or the terraform apply is executed.”

160
Q

Open-source Terraform can only import publicly-accessible and open-source modules.

A. True
B. False

A

B

Explanation:
Terraform can load modules from a public or private registry. This makes it possible to publish modules for others to use, and to use modules that others have published. Also, members of your organization might produce modules specifically crafted for your own infrastructure needs. Terraform Cloud and Terraform Enterprise both include a private module registry for sharing modules internally within your organization. Source: https://www.terraform.io/language/modules

161
Q

Terra form installs its providers during which phase?

A. Man
B. Init
C. Refresh
D. All of the above

A

B

Explanation:
Providers are installed in the init phase.

162
Q

Terraform plan updates your state file.

A. True
B. False

A

B

Explanation:
The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure. The plan command alone will not actually carry out the proposed changes, and so you can use this command to check whether the proposed changes match what you expected before you apply the changes or share your changes with your team for broader review. Source: https://www.terraform.io/cli/commands/plan

163
Q

Which task does teraform init not perform?

A. Sources any modules and copies the configuration locally
B. Validates all required variables are present
C. Connects to the backend
D. Sources all providers present in the configuration and ensures they are downloaded and available locally

A

B

164
Q

You have to initialize a Terraform backend before it can be configured.

A. True
B. False

A

A

Explanation:
Initialization
Whenever a configuration’s backend changes, you must run terraform init again to validate and configure the backend before you can perform any plans, applies, or state operations.
When changing backends, Terraform will give you the option to migrate your state to the new backend. This lets you adopt backends without losing any existing state.
To be extra careful, we always recommend manually backing up your state as well. You can do this by simply copying your terraform.tfstate file to another location. The initialization process should create a backup as well, but it never hurts to be safe!

165
Q

While attempting to deploy resources into your cloud provider using Terraform. you begin to see some odd behavior and experience sluggish responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform’s logging more verbose?

A. TF_10G_PATM
B. TF_LOG
C. TF_10G_LEVEL
D. TF.LOG.FUE

A

B

Reference:
https://www.terraform.io/internals/debugging

166
Q

The Terraform CLI will print output values from a child module after running terraform apply.

A. True
B. False

A

A

167
Q

As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provision is best to use in your Terraform code?

A. local-exec
B. file
C. null-exec
D. remote-exec

A

D

Reference:
https://www.terraform.io/language/resources/provisioners/remote-exec

168
Q

If a DevOps team adopts AWS Cloud Formation as their standardized method for provisioning public cloud resources, which of the following scenarios poses a challenge for this team?

A. The team is asked to manage a new application stack built on AWS-natrve services
B. The organization decides to expand into Azure and wishes to deploy new infrastructure using their existing codebase
C. The team is asked to build a reusable code base that can deploy resources into any AWS region
D. The DevOps team is tasked with automating a manual provisioning process

A

B

169
Q

Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files without changing their contents.

A. True
B. False

A

B

170
Q

How would you be able to reference an attribute from the vsphere_datacenter data source for use with the argument within the vsprere_folder resource in the following configuration?

A. vsphere_datacenter.dc.id
B. data.vsphere_datacenter.dc
C. data.dc,id
D. data.vsphere_datacenter.dc.id

A

D