Month End Sale - Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70dumps

Terraform-Associate-004 Questions and Answers

Question # 6

You can configure Terraform to log to a file using the TF_LOG environment variable.

A.

True

B.

False

Full Access
Question # 7

How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?

A.

It can execute Terraform runs on dedicated infrastructure in Terraform Cloud

B.

It doesn't show the output of a terraform apply locally

C.

It is only arable lo paying customers

D.

All of the above

Full Access
Question # 8

If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.

A.

True

B.

False

Full Access
Question # 9

Variables declared within a module are accessible outside of the module.

A.

True

B.

False

Full Access
Question # 10

You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully. What will happen if you terraform apply again immediately afterward without changing any Terraform code?

A.

Terraform will terminate and recreate the VM.

B.

Terraform will create another duplicate VM.

C.

Terraform will apply the VM to the state file.

D.

Nothing

Full Access
Question # 11

You cannot install third party plugins using terraform init.

A.

True

B.

False

Full Access
Question # 12

terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?

Error:

yaml

CopyEdit

Error loading state: AccessDenied: Access Denied

status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com

A.

Run terraform login to reauthenticate with the provider.

B.

Set TF_LOG=DEBUG.

C.

Review /var/log/terraform.log for error messages.

D.

Review syslog for Terraform error messages.

Full Access
Question # 13

Which of the following is not an action performed by terraform init?

A.

Initialize a configured backend.

B.

Create template configuration files.

C.

Load required provider plugins.

D.

Retrieve the source code for all referenced modules.

Full Access
Question # 14

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

A.

Set

B.

Map

C.

Tuple

D.

list

Full Access
Question # 15

Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)

A.

You can enforce a list of approved AWS AMIs.

B.

Sentinel Policies can be written in HashiCorp Configuration Language (HCL).

C.

You can check out and check in cloud access keys.

D.

Policy-as-code can enforce security best practices.

Full Access
Question # 16

Which of the following is not a valid Terraform variable type?

A.

list

B.

array

C.

nap

D.

string

Full Access
Question # 17

Which statement describes a goal of Infrastructure as Code (IaC)?

A.

A pipeline process to test and deliver software.

B.

Write once, run anywhere.

C.

The programmatic configuration of resources.

D.

Defining a vendor-agnostic API.

Full Access
Question # 18

_______backends support state locking.

A.

All

B.

No

C.

Some

D.

Only local

Full Access
Question # 19

terraform plan updates your state file.

A.

True

B.

False

Full Access
Question # 20

When you initialize Terraform, where does it cache modules from the public Terraform Registry?

A.

In the /tmp directory.

B.

In the .terraform sub-directory.

C.

In memory.

D.

They are not cached.

Full Access
Question # 21

A terraform apply can not _________ infrastructure.

A.

change

B.

destroy

C.

provision

D.

import

Full Access
Question # 22

What is the name of the default file where Terraform stores the state?

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

Full Access
Question # 23

You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick the 3 correct responses)

A.

In an HCP Terraform/Terraform Cloud variable, with the sensitive option checked.

B.

In HashiCorp Vault.

C.

In a terraform.tfvars file, securely managed and shared with your team.

D.

In a terraform.tfvars file, checked into your version control system.

E.

In a plaintext document on a shared drive.

Full Access
Question # 24

What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.

A.

You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.

B.

You can check out and check in cloud access keys

C.

Sentinel Policies can be written in HashiCorp Configuration Language (HCL)

D.

Policy-as-code can enforce security best practices

E.

You can enforce a list of approved AWS AMIs

Full Access
Question # 25

Which option cannot be used to keep secrets out of Terraform configuration files?

A.

A Terraform provider

B.

Environment variables

C.

A -var flag

D.

secure string

Full Access
Question # 26

Terraform installs its providers during which phase?

A.

Plan

B.

Init

C.

Refresh

D.

All of the above

Full Access
Question # 27

Which command add existing resources into Terraform state?

A.

Terraform init

B.

Terraform plan

C.

Terraform refresh

D.

Terraform import

E.

All of these

Full Access
Question # 28

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 correct answers.

A.

Run the terraform Import-gcp command

B.

Write Terraform configuration for the existing VMs

C.

Use the terraform import command for the existing VMs

D.

Provision new VMs using Terraform with the same VM names

Full Access
Question # 29

How can terraform plan aid in the development process?

A.

Initializes your working directory containing your Terraform configuration files

B.

Validates your expectations against the execution plan without permanently modifying state

C.

Formats your Terraform configuration files

D.

Reconciles Terraform's state against deployed resources and permanently modifies state using the current status of deployed resources

Full Access
Question # 30

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

A.

Tear down the entire workspace's infrastructure and rebuild it.

B.

Build a completely brand new set of infrastructure.

C.

Rebuild only the instances that were deleted.

D.

Stop and generate an error message about the missing instances.

Full Access
Question # 31

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.

A.

True

B.

False

Full Access
Question # 32

If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, 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-native services

B.

The organization decides to expand into Azure wishes to deploy new infrastructure

C.

The team is asked to build a reusable code based that can deploy resources into any AWS region

D.

The DevOps team is tasked with automating a manual, web console-based provisioning.

Full Access
Question # 33

Which command does not cause Terraform to refresh its state?

A.

terraform state list

B.

terraform plan

C.

terraform apply

D.

terraform destroy

Full Access
Question # 34

One cloud block always maps to a single HCP Terraform/Terraform Cloud workspace.

A.

True

B.

False

Full Access
Question # 35

All standard backend types support state locking, and remote operations like plan, apply, and destroy.

A.

True

B.

False

Full Access
Question # 36

What functionality do providers offer in Terraform?(Pick 3 correct responses)

A.

Interact with cloud provider APIs.

B.

Provision resources for on-premises infrastructure services.

C.

Group a collection of Terraform configuration files that map to a single state file.

D.

Provision resources for public cloud infrastructure services.

E.

Enforce security and compliance policies.

Full Access
Question # 37

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

A.

True

B.

False

Full Access
Question # 38

What feature stops multiple users from operating on the Terraform state at the same time?

A.

State locking

B.

Version control

C.

Provider constraints

D.

Remote backends

Full Access
Question # 39

When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?

A.

In an environment variable

B.

On the disk

C.

In the remote backend or Terraform Cloud

D.

In memory

Full Access
Question # 40

Which of these commands makes your code more human readable?

A.

Terraform validate

B.

Terraform output

C.

Terraform show

D.

Terraform file

Full Access
Question # 41

How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?

A.

Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces

B.

Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to

C.

Only Terraform Cloud organization owners can approve plans in VCS connected workspaces

D.

Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces

Full Access
Question # 42

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

Which command will migrate your current state file to the new S3 remote backend?

A.

terraform state

B.

terraform init

C.

terraform push

D.

terraform refresh

Full Access
Question # 43

You have used Terraform lo create an ephemeral development environment in the (loud 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 Terraform will delete.

Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.

A.

Run terraform state rm ‘

B.

Run terraform show :destroy

C.

Run terraform destroy and it will first output all the resource that will be deleted before prompting for approval

D.

Run terraform plan .destory

Full Access
Question # 44

Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?

A.

terraform state list ‘provider_type.name’

B.

terraform state show ‘provider_type.name’

C.

terraform get ‘provider_type.name’

D.

terraform state list

Full Access
Question # 45

A resource block is shown in the Exhibit space of this page. How would you reference the name value of the second instance of this resource?

A.

aws_instance.web[2].name

B.

aws_instance.web.*.name

C.

aws_instance.web[l].name

D.

aws_instance.web[l]

E.

element(aws_instance.web, 2)

Full Access
Question # 46

Terraform configuration (including any module references) can contain only one Terraform provider type.

A.

True

B.

False

Full Access
Question # 47

The_________determines how Terraform creates, updates, or delete resources.

A.

Terraform configuration

B.

Terraform provisioner

C.

Terraform provider

D.

Terraform core

Full Access
Question # 48

The Terraform binary version and provider versions must match each other in a single configuration.

A.

True

B.

False

Full Access
Question # 49

What kind of configuration block will create an infrastructure object with settings specified within the block?

A.

provider

B.

state

C.

data

D.

resource

Full Access
Question # 50

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

A.

True

B.

False

Full Access
Question # 51

What does state looking accomplish?

A.

Prevent accidental Prevent accident deletion of the state file

B.

Blocks Terraform commands from modifying, the state file

C.

Copies the state file from memory to disk

D.

Encrypts any credentials stored within the state file

Full Access
Question # 52

You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?

A.

Terraform data sources

B.

Terraform local values

C.

Terraform modules

D.

Terraform workspaces

E.

None of the above

Full Access
Question # 53

Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Cloud automatically and proactively enforce this security control?

A.

Auditing cloud storage buckets with a vulnerability scanning tool

B.

By adding variables to each Terraform Cloud workspace to ensure these settings are always enabled

C.

With an S3 module with proper settings for buckets

D.

With a Sentinel policy, which runs before every apply

Full Access
Question # 54

Define the purpose of state in Terraform.

A.

State maps real world resources to your configuration and keeps track of metadata

B.

State lets you enforce resource configurations that relate to compliance policies

C.

State stores variables and lets you quickly reuse existing code

D.

State codifies the dependencies of related resources

Full Access
Question # 55

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

A.

The ability to share modules publicly with any user of Terraform

B.

The ability to restrict modules to members of Terraform Cloud or Enterprise organizations

C.

The ability to tag modules by version or release

D.

The ability to share modules with public Terraform users and members of Terraform Cloud Organizations

Full Access
Question # 56

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

A.

source - "github.com/hashicorp/examplePref-ul.0.8M

B.

source = "./module?version=vl.6.0"

C.

source - "hashicorp/consul/aws"

D.

source - "./module"

Full Access
Question # 57

Which of the following locations can Terraform use as aprivate sourcefor modules?(Pick 2 correct responses)

A.

Public repository on GitHub.

B.

Public Terraform Registry.

C.

Internally hosted VCS (Version Control System) platform.

D.

Private repository on GitHub.

Full Access
Question # 58

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?

A.

Edit your state file to scrub out the sensitive data

B.

Always store your secrets in a secrets.tfvars file

C.

Delete the state file every time you run Terraform

D.

Store the state in an encrypted backend

Full Access
Question # 59

Why does this backend configuration not follow best practices?

A.

An alias meta-argument should be included in backend blocks whenever possible

B.

You should use the local enhanced storage backend whenever possible

C.

You should not store credentials in Terraform configuration

D.

The backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply

Full Access
Question # 60

Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?

A.

curl commands manually run from a terminal

B.

A sequence of REST requests you pass to a public cloud API endpoint Most Voted

C.

A script that contains a series of public cloud CLI commands

D.

A series of commands you enter into a public cloud console

Full Access
Question # 61

A developer launched a VM outside of the Terraform workflow and ended up with two servers with the same name. They are unsure which VM is managed with Terraform, but they do have a list of all active VM IDs. Which method could you use to determine which instance Terraform manages?

A.

Modify the Terraform configuration to add an import block for both of the virtual machines.

B.

Run a terraform apply -refresh to identify the virtual machine IDs that are already managed by Terraform.

C.

Run terraform state rm on both VMs, then terraform apply to recreate the correct one.

D.

Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages.

Full Access
Question # 62

Terraform providers are part of the Terraform core binary.

A.

True

B.

False

Full Access
Question # 63

You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:

When you run terraform validate, you get the following error:

What must you do to successfully retrieve this value from your networking module?

A.

Change the reference value to my-network,outputs,vmet_id

B.

Define the attribute vmet_id as a variable in the networking modeule

C.

Define the attribute vnet_id as an output in the networking module

D.

Change the reference value module.my,network,outputs,vnet_id

Full Access
Question # 64

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?

A.

The Terraform CD needs you to log into Terraform Cloud first

B.

Terraform requires you to manually run terraform plan first

C.

Terraform needs to install the necessary plugins first

D.

Terraform needs you to format your code according to best practices first

Full Access
Question # 65

Terraform configuration can only import modules from the public registry.

A.

True

B.

False

Full Access
Question # 66

Only the user that generated a plan may apply it.

A.

True

B.

False

Full Access
Question # 67

Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.

A.

True

B.

False

Full Access
Question # 68

Which argument can you use toprevent unexpected updatesto a module's configuration when calling Terraform Registry modules?

A.

source

B.

count

C.

version

D.

lifecycle

Full Access
Question # 69

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.

Count arguments

C.

Collection functions

D.

Dynamic blocks

Full Access
Question # 70

You're building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?

A.

Copy the sensitive variables into your Terraform code

B.

Store the sensitive variables in a secure_varS.tf file

C.

Store the sensitive variables as plain text in a source code repository

D.

Pass variables to Terraform with a -var flag

Full Access
Question # 71

You can access state stored with the local backend by using terraform_remote_state data source.

A.

True

B.

False

Full Access
Question # 72

Which of these statements about Terraform Cloud workspaces is false?

A.

They have role-based access controls

B.

You must use the CLI to switch between workspaces

C.

Plans and applies can be triggered via version control system integrations

D.

They can securely store cloud credentials

Full Access
Question # 73

Terraform configuration can only call modules from the public registry.

A.

True

B.

False

Full Access
Question # 74

Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

A.

Lets you version, reuse, and share infrastructure configuration

B.

Provisions the same resources at a lower cost

C.

Secures your credentials

D.

Reduces risk of operator error

E.

Prevents manual modifications to your resources

Full Access
Question # 75

Module version is required to reference a module on the Terraform Module Registry.

A.

True

B.

False

Full Access
Question # 76

What task does the terraform import command perform?

A.

Imports resources from one Terraform state file to another.

B.

Imports existing resources into Terraform's state file.

C.

Imports a new Terraform module into Terraform's state file.

D.

Imports all infrastructure from the configured cloud provider.

E.

Imports provider configuration from one state file to another.

Full Access
Question # 77

Which of the following is not a valid Terraform collection type?

A.

Tree

B.

Map

C.

List

D.

set

Full Access