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

Terraform-Associate-003 Questions and Answers

Question # 6

What does Terraform not reference when running a terraform apply -refresh-only ?

A.

State file

B.

Credentials

C.

Cloud provider

D.

Terraform resource definitions in configuration files

Full Access
Question # 7

How does Terraform manage most dependencies between resources?

A.

Terraform will automatically manage most resource dependencies

B.

Using the depends_on parameter

C.

By defining dependencies as modules and including them in a particular order

D.

The order that resources appear in Terraform configuration indicates dependencies

Full Access
Question # 8

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 # 9

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 # 10

What is the purpose of the terraform.lock.hcl file in Terraform?

A.

There is no such file.

B.

Storing references to workspaces, which are locked.

C.

Preventing Terraform runs from occurring.

D.

Tracking specific provider dependencies.

Full Access
Question # 11

Which two steps are required to provision new infrastructure in the Terraform workflow?

(Pick the 2 correct responses below)

A.

import

B.

plan

C.

validate

D.

init

E.

apply

Full Access
Question # 12

terraform validate uses provider APIs to verify your infrastructure settings.

A.

True

B.

False

Full Access
Question # 13

Which command must you first run before performing further Terraform operations in a working directory?

A.

terraform import

B.

terraform workspace

C.

terraform plan

D.

terraform init

Full Access
Question # 14

Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.

A.

True

B.

False

Full Access
Question # 15

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 # 16

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.

file("id_rsa.pub")

B.

templaTefil("id_rsa.pub")

C.

filebase64("id_rsa.pub")

D.

fileset<"id_rsa.pub")

Full Access
Question # 17

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

A.

True

B.

False

Full Access
Question # 18

Only the user that generated a plan may apply it.

A.

True

B.

False

Full Access
Question # 19

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 # 20

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 # 21

What is the workflow for deploying new infrastructure with Terraform?

A.

Write Terraform configuration, run terraform init to initialize the working directory orworkspace, and run terraform apply

B.

Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure

C.

Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly

D.

Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure

Full Access
Question # 22

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 # 23

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 Most Voted

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

Full Access
Question # 24

A provider configuration block is required in every Terraform configuration.

Example:

A.

True

B.

False

Full Access
Question # 25

You much initialize your working directory before running terraform validate.

A.

True

B.

False

Full Access
Question # 26

In a Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.

A.

True

B.

False

Full Access
Question # 27

If a module declares a variable with a default, that variable must also be defined within the module.

A.

True

B.

False

Full Access
Question # 28

Which of the following should you add in the required_providers block to define a provider version constraint?

A.

version

B.

version = "3.1"

C.

version: 3.1

D.

version - 3.1

Full Access
Question # 29

Where does the Terraform local backend store its state?

A.

In the terraform file

B.

In the /tmp directory

C.

In the terraform,tfstate file

D.

In the user’s terraform,state file

Full Access
Question # 30

Which of these is true about Terraform's plugin-based architecture?

A.

Terraform can only source providers from the internet

B.

Every provider in a configuration has its own state file for its resources

C.

You can create a provider for your API if none exists

D.

All providers are part of the Terraform core binary

Full Access
Question # 31

Which of the following is not a way to trigger terraform destroy?

A.

Using the destroy command with auto-approve.

B.

Passing --destroy at the end of a plan request.

C.

Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.

Full Access
Question # 32

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

A.

True

B.

False

Full Access
Question # 33

You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.

You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.

In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.

What will happen when you run terraform apply upon returning to your desk?

A.

Terraform will recreate the load balancer.

B.

Terraform will fail with an error because the state file is no longer accurate.

C.

Terraform will change the load balancer port to 80, and then change it back to 443.

D.

Terraform will not make any changes to the load balancer and will update the state file to reflect the manual change.

Full Access
Question # 34

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 # 35

You have developed a new cloud-based service that uses proprietary APIs and want to use Terraform to create, manage, and delete users from the service. How can Terraform interact with the service?

A.

Terraform can manage users for any service that is hosted on a public cloud provider.

B.

Develop and publish a custom provider to interact with the service using its proprietary APIs.

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

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

A.

True

B.

False

Full Access
Question # 38

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

A.

True

B.

False

Full Access
Question # 39

When should you run terraform init?

A.

Every time you run terraform apply

B.

Before you start coding a new Terraform project

C.

After you run terraform plan for the time in a new terraform project and before you run terraform apply

D.

After you start coding a new terraform project and before you run terraform plan for the first time.

Full Access
Question # 40

You 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 Terraform will delete.

Which command should you use to show all the resources that will be deleted? (Pick the 2 correct responses)

A.

Runterraform destroy. This will output all the resources that will be deleted before prompting for approval.

B.

Runterraform show -destroy.

C.

Runterraform state rm *.

Full Access
Question # 41

In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.

A.

True

B.

False

Full Access
Question # 42

When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)

A.

When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply

B.

Changing resources via the Azure Cloud Console records the change in the current state file

C.

When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file

D.

Changing resources via the Azure Cloud Console does not update current state file

Full Access
Question # 43

Terraform variables and outputs that set the description argument will store that description in the state file.

A.

True

B.

False

Full Access
Question # 44

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

A.

Before the plan phase

B.

During the plan phase

C.

Before the apply phase

D.

After the apply phase

Full Access
Question # 45

What is modified when executing Terraform inrefresh-only mode?

A.

Your Terraform configuration.

B.

Your Terraform plan.

C.

Your state file.

D.

Your cloud infrastructure.

Full Access
Question # 46

Where in your Terraform configuration do you specify a state backend?

A.

The resource block

B.

The data source block

C.

The terraform block

D.

The provider block

Full Access
Question # 47

What is a key benefit of the Terraform state file?

A.

A state file can schedule recurring infrastructure tasks

B.

A state file is a source of truth for resources provisioned with Terraform

C.

A state file is a source of truth for resources provisioned with a public cloud console

D.

A state file is the desired state expressed by the Terraform code files

Full Access
Question # 48

A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.

A.

True

B.

False

Full Access
Question # 49

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

A.

Run terraform refresh.

B.

Run terraform init -upgrade.

C.

Run terraform apply -upgrade.

D.

Upgrade your version of Terraform.

Full Access
Question # 50

Which of the following module source paths does not specify a remote module?

A.

Source = “module/consul’’

B.

Source = ‘’githhub.comicrop/example’’

C.

Source =’’git@github.com:hasicrop/example.git’’

D.

Source = ‘’hasicrop/consul/aws’’

Full Access
Question # 51

As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?

A.

Make the change via the public cloud API endpoint

B.

Clone the repository containing your infrastructure code and then run the code

C.

Use the public cloud console to make the change after a database record has been approved

D.

Make the change programmatically via the public cloud CLI

E.

Submit a pull request and wait for an approved merge of the proposed changes

Full Access
Question # 52

Using the terraform state rm command against a resource will destroy it.

A.

True

B.

False

Full Access
Question # 53

Which are forbidden actions when the terraform state file is locked? Choose three correct answers.

A.

Terraform state list

B.

Terraform destroy

C.

Terraform validate

D.

Terraform validate

E.

Terraform for

F.

Terraform apply

Full Access
Question # 54

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 # 55

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 # 56

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 # 57

Which of these are features of Terraform Cloud? Choose two correct answers.

A.

A web-based user interface (Ul)

B.

Automated infrastructure deployment visualization

C.

Automatic backups

D.

Remote state storage

Full Access
Question # 58

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

A.

Versioning

B.

A Graphical User Interface

C.

Reusability of code

D.

Automation

Full Access
Question # 59

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

A.

Set

B.

Map

C.

Tuple

D.

list

Full Access
Question # 60

A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?

A.

resource.kubernetes_namespace.example.name

B.

kubernetes_namespace.example.name

C.

data.kubernetes.namespace.name

D.

kubernetes_namespace.test.name

Full Access
Question # 61

Terraform configuration can only import modules from the public registry.

A.

True

B.

False

Full Access
Question # 62

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 # 63

You can develop a custom provider to manage its resources using Terraform.

A.

True

B.

False

Full Access
Question # 64

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 # 65

When you use a backend that requires authentication, it is best practice to:

A.

Run all Terraform commands on a shared server or container.

B.

Configure the authentication credentials in your Terraform configuration files, and store them in version control.

C.

Use environment variables to configure authentication credentials outside of your Terraform configuration.

D.

None of the above.

Full Access
Question # 66

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 # 67

By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?

A.

A subdirectory of your home directory named .terraform.d

B.

A file in your configuration's directory named terraform.tfstate

C.

A file in your configuration's directory named .terraform.lock.hcl

D.

A subdirectory of your configuration named .terraform

Full Access
Question # 68

Which of the following statements about Terraform modules is not true?

A.

Modules can call other modules

B.

A module is a container for one or more resources

C.

Modules must be publicly accessible

D.

You can call the same module multiple times

Full Access
Question # 69

Before you can use a remote backend, you must first execute terra-form init.

A.

True

B.

False

Full Access
Question # 70

What type of block is used to construct a collection of nested configuration blocks?

A.

Dynamic

B.

For_each

C.

Nesting

D.

repeated.

Full Access
Question # 71

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 # 72

terraform init retrieves and caches the configuration for all remote modules.

A.

True

B.

False

Full Access
Question # 73

terraform plan updates your state file.

A.

True

B.

False

Full Access
Question # 74

Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

A.

terraform destroy, then terraform apply

B.

terraform init

C.

terraform push

D.

terraform apply

Full Access
Question # 75

A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.

Which of the following methods could you use to discover which instance Terraform manages?

A.

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

B.

Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs

C.

Run terraform taint/code on all the VMs to recreate them

D.

Use terraform refresh/code to find out which IDs are already part of state

Full Access