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

Terraform-Associate-003 Questions and Answers

Question # 6

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

A.

True

B.

False

Full Access
Question # 7

Terraform configuration can only import modules from the public registry.

A.

True

B.

False

Full Access
Question # 8

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

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

When does Terraform create the .terraform.lock.hc1 file?

A.

After your first terraform plan

B.

After your first terraform apply

C.

After your first terraform init

D.

When you enable state locking

Full Access
Question # 11

It is best practice to store secret data in the same version control repository as your Terraform configuration.

A.

True

B.

False

Full Access
Question # 12

You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.

Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?

A.

Terraform will prompt you to pick which resource you want to destroy

B.

Terraform will destroy the application server because it is listed first in the code

C.

Terraform will prompt you to confirm that you want to destroy all the infrastructure

D.

Terraform will destroy the main, tf file

E.

Terraform will immediately destroy all the infrastructure

Full Access
Question # 13

Which of the following does terraform apply change after you approve the execution plan? (Choose two.)

A.

Cloud infrastructure Most Voted

B.

The .terraform directory

C.

The execution plan

D.

State file

E.

Terraform code

Full Access
Question # 14

A module can always refer to all variables declared in its parent module.

A.

True

B.

False

Full Access
Question # 15

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

A.

End-users have to request infrastructure changes

B.

Ticket based systems generate a full audit trail of the request and fulfillment process

C.

Users can access catalog of approved resources from drop down list in a request form

D.

The more resources your organization needs, the more tickets your infrastructure team has to process

Full Access
Question # 16

Which are examples of infrastructure as code? Choose two correct answers.

A.

Cloned virtual machine images

B.

Versioned configuration files

C.

Change management database records

D.

Doctor files

Full Access
Question # 17

Which provider authentication method prevents credentials from being stored in the state file?

A.

Using environment variables

B.

Specifying the login credentials in the provider block

C.

Setting credentials as Terraform variables

D.

None of the above

Full Access
Question # 18

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

A.

True

B.

False

Full Access
Question # 19

What is one disadvantage of using dynamic blocks in Terraform?

A.

Dynamic blocks can construct repeatable nested blocks

B.

Terraform will run more slowly

C.

They cannot be used to loop through a list of values

D.

They make configuration harder to read and understand

Full Access
Question # 20

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

Infrastructure as Code (laC) can be stored in a version control system along with application code.

A.

True

B.

False

Full Access
Question # 22

You must use different Terraform commands depending on the cloud provider you use.

A.

True

B.

False

Full Access
Question # 23

When you include a module block in your configuration that references a module from the Terraform Registry, the "version" attribute is required.

A.

True

B.

False

Full Access
Question # 24

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

A.

list

B.

array

C.

nap

D.

string

Full Access
Question # 25

As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?

A.

terraform refresh -upgrade

B.

terraform apply -upgrade

C.

terraform init -upgrade

D.

terraform providers -upgrade

Full Access
Question # 26

You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.

What will happen you run terraform apply in the working directory again?

A.

Terraform will remove the virtual machine from the state file, but the resource will still exist

B.

Nothing

C.

Terraform will error

D.

Terraform will destroy the virtual machine

Full Access
Question # 27

Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?

A.

They can securely store cloud credentials.

B.

They have role-based access controls.

C.

Plans and applies can be triggered via version control system integrations.

D.

You must use the CLI to switch between workspaces.

Full Access
Question # 28

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

Which of the following should you put into the required_providers block?

A.

version >= 3.1

B.

version = “>= 3.1”

C.

version ~> 3.1

Full Access
Question # 30

Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)

A.

terraform apply

B.

terraform state list

C.

terraform destroy

D.

terraform fmt

Full Access
Question # 31

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

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

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

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

A.

True

B.

False

Full Access
Question # 35

When should you use the force-unlock command?

A.

You have a high priority change

B.

Automatic unlocking failed

C.

apply failed due to a state lock

D.

You see a status message that you cannot acquire the lock

Full Access
Question # 36

Which of these commands makes your code more human readable?

A.

Terraform validate

B.

Terraform output

C.

Terraform show

D.

Terraform fmt

Full Access
Question # 37

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

A.

True

B.

False

Full Access
Question # 38

Which command(s) adds existing resources in a public cloud into Terraform state?

A.

terraform init

B.

terraform plan

C.

terraform refresh

D.

terraform import

E.

All of these

Full Access
Question # 39

You much initialize your working directory before running terraform validate.

A.

True

B.

False

Full Access
Question # 40

What does the default "local" Terraform backend store?

A.

tfplan files

B.

State file

C.

Provider plugins

D.

Terraform binary

Full Access
Question # 41

What does terraform import do?

A.

Imports existing resources into the state file

B.

Imports all infrastructure from a given cloud provider

C.

Imports a new Terraform module

D.

Imports clean copies of tainted resources

E.

None of the above

Full Access
Question # 42

Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.

A.

Automated infrastructure deployment visualization.

B.

A web-based user interface (UI).

C.

Automatic backups of configuration and state.

D.

Remote state storage.

Full Access
Question # 43

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

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

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

A.

Set

B.

Map

C.

Tuple

D.

list

Full Access
Question # 46

Which task does terraform init not perform?

A.

Validates all required variables are present

B.

Sources any modules and copies the configuration locally

C.

Connects to the backend

D.

Sources all providers used in the configuration and downloads them

Full Access
Question # 47

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

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

A.

Terraform state show ‘ provider_type_name

B.

Terraform state list

C.

Terraform get provider_type_name

D.

Terraform state list provider_type_name

Full Access
Question # 49

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

Why would you use the -replace flag for terraform apply?

A.

You want Terraform to ignore a resource on the next apply

B.

You want Terraform to destroy all the infrastructure in your workspace

C.

You want to force Terraform to destroy a resource on the next apply

D.

You want to force Terraform to destroy and recreate a resource on the next apply

Full Access
Question # 51

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

When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?

A.

Alias

B.

Id

C.

Depends_on

D.

name

Full Access
Question # 53

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

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

Terraform providers are part of the Terraform core binary.

A.

True

B.

False

Full Access
Question # 56

Where can Terraform not load a provider from?

A.

Plugins directory

B.

Provider plugin chance

C.

Official HashCrop Distribution on releases.hashcrop.com

D.

Source code

Full Access
Question # 57

Which parameters does terraform import require? Choose two correct answers.

A.

Provider

B.

Resource ID

C.

Resource address

D.

Path

Full Access
Question # 58

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

Full Access