Spring Sale 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

ExamsBrite Dumps

HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Question and Answers

HashiCorp Certified: Terraform Associate (004) (HCTA0-004)

Last Update Feb 28, 2026
Total Questions : 301

We are offering FREE Terraform-Associate-004 HashiCorp exam questions. All you do is to just go and sign up. Give your details, prepare Terraform-Associate-004 free exam questions and then go for complete pool of HashiCorp Certified: Terraform Associate (004) (HCTA0-004) test questions that will help you more.

Terraform-Associate-004 pdf

Terraform-Associate-004 PDF

$36.75  $104.99
Terraform-Associate-004 Engine

Terraform-Associate-004 Testing Engine

$43.75  $124.99
Terraform-Associate-004 PDF + Engine

Terraform-Associate-004 PDF + Testing Engine

$57.75  $164.99
Questions 1

terraform init creates an example main.tf file in the current directory.

Options:

A.  

True

B.  

False

Discussion 0
Questions 2

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

Options:

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.

Discussion 0
Questions 3

What is the provider for the resource shown in the Exhibit?

resource "aws_vpc" "main" {

name = "test"

}

Options:

A.  

VPC

B.  

test

C.  

main

D.  

aws

Discussion 0
Questions 4

Where does the Terraform local backend store its state?

Options:

A.  

In the terraform file

B.  

In the /tmp directory

C.  

In the terraform,tfstate file

D.  

In the user’s terraform,state file

Discussion 0
Questions 5

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)

Options:

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

Discussion 0
Questions 6

What does state looking accomplish?

Options:

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

Discussion 0
Questions 7

A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?

Options:

A.  

test

B.  

google

C.  

compute_instance

D.  

main

Discussion 0
Questions 8

terraform validate uses provider APIs to verify your infrastructure settings.

Options:

A.  

True

B.  

False

Discussion 0
Questions 9

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Options:

A.  

terraform fmt -write-false

B.  

terraform fmt -list -recursive

C.  

terraform fmt -check -recursive

D.  

terraform fmt -check

Discussion 0
Questions 10

Which parameters does the import block require? (Pick the 2 correct responses below.)

Options:

A.  

The resource ID

B.  

Provider

C.  

The target resource address

D.  

Backend

Discussion 0
Questions 11

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?

Options:

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)

Discussion 0
Questions 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?

Options:

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

Discussion 0
Questions 13

What is modified when executing Terraform inrefresh-only mode?

Options:

A.  

Your Terraform configuration.

B.  

Your Terraform plan.

C.  

Your state file.

D.  

Your cloud infrastructure.

Discussion 0
Questions 14

What is the Terraform style convention for indenting a nesting level compared to the one above it?

Options:

A.  

With a tab

B.  

With two spaces

C.  

With four spaces

D.  

With three spaces

Discussion 0
Questions 15

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 delete the VM using the cloud provider console, then run terraform apply again without changing any Terraform code?

Options:

A.  

Terraform will recreate the VM.

B.  

Terraform will report an error.

C.  

Terraform will remove the VM from the state file.

D.  

Terraform will not make any changes.

Discussion 0
Questions 16

What is one disadvantage of using dynamic blocks in Terraform?

Options:

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

Discussion 0
Questions 17

What is the Terraform style convention for indenting a nesting level compared to the one above it?

Options:

A.  

With two spaces.

B.  

With four spaces.

C.  

With three spaces.

D.  

With a tab.

Discussion 0
Questions 18

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.

Options:

A.  

True

B.  

False

Discussion 0
Questions 19

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

Options:

A.  

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

B.  

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

C.  

source - "hashicorp/consul/aws"

D.  

source - "./module"

Discussion 0
Questions 20

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

Options:

A.  

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

B.  

Provision resources for on-premises infrastructure services.

C.  

Provision resources for public cloud infrastructure services.

D.  

Interact with cloud provider APIs.

E.  

Enforce security and compliance policies.

Discussion 0
Questions 21

Exhibit.

You need to deploy resources into two different regions in the same Terraform configuration. To do this, you declare multiple provider configurations as shown in the Exhibit space on this page.

What meta-argument do you need to configure in a resource block to deploy the resource to the us-west-2 AWS region?

Options:

A.  

provider = aws.west

B.  

alias = aws.west

C.  

provider = west

D.  

alias = west

Discussion 0
Questions 22

Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources. Which scenario presents a challenge for your team?

Options:

A.  

Building a reusable code base that can deploy resources into any AWS region.

B.  

Managing a new application stack built on AWS-native services.

C.  

Automating a manual, web console-based provisioning process.

D.  

Deploying new infrastructure into Microsoft Azure.

Discussion 0
Questions 23

The terraform output command shows outputs from child modules.

Options:

A.  

True

B.  

False

Discussion 0
Questions 24

A developer on your team is going to leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?

Options:

A.  

Terraform plan rm:aws_instance.ubuntu[1]

B.  

Terraform state rm:aws_instance.ubuntu[1]

C.  

Terraform apply rm:aws_instance.ubuntu[1]

D.  

Terraform destory rm:aws_instance.ubuntu[1]

Discussion 0
Questions 25

Which Terraform command checks that your configuration syntax is correct?

Options:

A.  

terraform validate

B.  

terraform init

C.  

terraform show

D.  

terraform fmt

Discussion 0
Questions 26

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?

Options:

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

Discussion 0
Questions 27

Exhibit:

Root module configuration:

output "vnet_id" {

value = module.my_network.vnet_id

}

Error:

Error: Reference to undeclared output value

on main.tf line 12, in output "vnet_id":

12: value = module.my_network.vnet_id

You are using a networking module in your Terraform configuration with the name my_network. Your root module includes the configuration shown. When you run terraform validate, you get the error shown. Which option would successfully retrieve this value from your networking module?

Options:

A.  

Change the referenced value to module.my_network.outputs.vnet_id.

B.  

Define the attribute vnet_id as a variable in the networking module.

C.  

Change the referenced value to my_network.outputs.vnet_id.

D.  

Define the attribute vnet_id as an output in the networking module.

Discussion 0
Questions 28

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

Options:

A.  

terraform apply

B.  

terraform state list

C.  

terraform destroy

D.  

terraform fmt

Discussion 0
Questions 29

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

Options:

A.  

Prevents manual modifications to your resources

B.  

Lets you version, reuse, and share infrastructure configuration

C.  

Secures your credentials

D.  

Provisions the same resources at a lower cost

E.  

Reduces risk of operator error

Discussion 0
Questions 30

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

Options:

A.  

resource

B.  

provider

C.  

data

D.  

locals

Discussion 0
Questions 31

Outside of the required_providers block, Terraform configurations always refer to providers by their local names.

Options:

A.  

True

B.  

False

Discussion 0
Questions 32

Exhibit:

resource "azurerm_linux_web_app" "app" {

name = "example-app"

resource_group_name = azurerm_resource_group.rg.name

location = azurerm_resource_group.rg.location

service_plan_id = azurerm_service_plan.plan.id

identity {

type = "UserAssigned"

identity_ids = [azurerm_user_assigned_identity.app.id]

}

}

resource "azurerm_role_assignment" "kv_access" {

scope = azurerm_key_vault.kv.id

role_definition_name = "Key Vault Secrets User"

principal_id = azurerm_user_assigned_identity.app.principal_id

}

Two resource blocks are shown: azurerm_linux_web_app and azurerm_role_assignment. When provisioned, the web app will use the role assignment during creation, so the role assignment must be created first. How do you ensure the azurerm_role_assignment resource is created first?

Options:

A.  

Add a depends_on argument to the azurerm_linux_web_app.

B.  

Add a create_before_destroy argument to the azurerm_role_assignment.

C.  

Change the order of the azurerm_linux_web_app and azurerm_role_assignment blocks.

D.  

Add a count argument to both resources.

Discussion 0
Questions 33

What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?

Options:

A.  

terraform refresh

B.  

terraform graph

C.  

terraform output

D.  

terraform show

Discussion 0
Questions 34

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?

Options:

A.  

terraform state

B.  

terraform init

C.  

terraform push

D.  

terraform refresh

Discussion 0
Questions 35

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 36

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

Options:

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.

Discussion 0
Questions 37

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?

Options:

A.  

file("id_rsa.pub")

B.  

templaTefil("id_rsa.pub")

C.  

filebase64("id_rsa.pub")

D.  

fileset<"id_rsa.pub")

Discussion 0
Questions 38

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?

Options:

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.

Discussion 0
Questions 39

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 40

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 41

You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.

Options:

A.  

True

B.  

False

Discussion 0
Questions 42

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?

Options:

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

Discussion 0
Questions 43

You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?

Options:

A.  

Remove the resource block from your configuration.

B.  

Change the value of the count argument on the resource.

C.  

Run terraform state rm aws_instance.ubuntu[1].

D.  

Use a moved block.

Discussion 0
Questions 44

You are tasked with making a change to an infrastructure stack running in a public cloud using HCP Terraform/Terraform Cloud. Which pattern follows IaC best practices?

Options:

A.  

Make the change via the public cloud API endpoint.

B.  

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

C.  

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

D.  

Use the public cloud console to make the change after approval.

E.  

Make the change programmatically via the cloud CLI.

Discussion 0
Questions 45

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

Options:

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.  

Terraform will take no action.

Discussion 0
Questions 46

Module variable assignments are inherited from the parent module and you do not need to explicitly set them.

Options:

A.  

True

B.  

False

Discussion 0
Questions 47

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

Options:

A.  

terraform init

B.  

terraform plan

C.  

terraform refresh

D.  

terraform import

E.  

All of these

Discussion 0
Questions 48

You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.

Which of these is the correct way to define the output value?

Options:

A.  

Option A

B.  

Option B

C.  

Option C

D.  

Option D

Discussion 0
Questions 49

Terraform configuration can only call modules from the public registry.

Options:

A.  

True

B.  

False

Discussion 0
Questions 50

What is a Terraform provider not responsible for?

Options:

A.  

Provisioning infrastructure in multiple cloud providers.

B.  

Managing actions to take based on resource differences.

C.  

Managing resources and data sources based on an API.

D.  

Understanding API interactions with a hosted service.

Discussion 0
Questions 51

You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.

Options:

A.  

True

B.  

False

Discussion 0
Questions 52

Which method for sharing Terraform configurations fulfills the following criteria:

1. Keeps the configurations confidential within your organization

2. Support Terraform’s semantic version constrains

3. Provides a browsable directory

Options:

A.  

Subfolder within a workspace

B.  

Generic git repository

C.  

Terraform Cloud private registry

D.  

Public Terraform module registry

Discussion 0
Questions 53

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

Options:

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

Discussion 0
Questions 54

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

Options:

A.  

A Terraform provider

B.  

Environment variables

C.  

A -var flag

D.  

secure string

Discussion 0
Questions 55

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

Options:

A.  

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

B.  

You want Terraform to ignore a resource on the next apply.

C.  

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

D.  

You want Terraform to destroy all the infrastructure in your workspace.

Discussion 0
Questions 56

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?

Options:

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.

Discussion 0
Questions 57

What does the default "local" Terraform backend store?

Options:

A.  

tfplan files

B.  

State file

C.  

Provider plugins

D.  

Terraform binary

Discussion 0
Questions 58

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?

Options:

A.  

Local values

B.  

Count arguments

C.  

Collection functions

D.  

Dynamic blocks

Discussion 0
Questions 59

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

Options:

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.

Discussion 0
Questions 60

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

Options:

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

Discussion 0
Questions 61

You cannot install third party plugins using terraform init.

Options:

A.  

True

B.  

False

Discussion 0
Questions 62

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

Options:

A.  

resource.kubernetes_namespace.example.name

B.  

kubernetes_namespace.example.name

C.  

data.kubernetes.namespace.name

D.  

kubernetes_namespace.test.name

Discussion 0
Questions 63

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

Options:

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

Discussion 0
Questions 64

Which is a benefit of the Terraform state file?

Options:

A.  

A state file can schedule recurring infrastructure tasks.

B.  

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

C.  

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

D.  

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

Discussion 0
Questions 65

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

Options:

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.

Discussion 0
Questions 66

Which of these workflows is only enabled by the use of Infrastructure as Code?

Options:

A.  

Automatic scaling of resources based on application load.

B.  

Role-based access control of cloud resources.

C.  

Cost optimization of infrastructure deployment.

D.  

Reviewing the proposed changes for potential security issues.

Discussion 0
Questions 67

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 68

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 69

Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.

How should they ensure the code satisfies conventions?

Options:

A.  

Terraform automatically formats configuration on terraform apply

B.  

Run terraform validate prior to executing terraform plan or terraform apply

C.  

Use terraform fmt

D.  

Replace all tabs with spaces

Discussion 0
Questions 70

Exhibit:

Error: Saved plan is stale

The given plan file can no longer be applied because the state was changed by another operation after the plan was created.

You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running terraform apply my.tfplan, you receive the error shown. How can you apply the desired changes? (Pick the 2 correct responses below.)

Options:

A.  

Generate a new execution plan file with terraform plan, and apply the new plan.

B.  

Run terraform apply without the saved execution plan.

C.  

Force the apply command by adding the flag -lock=false.

D.  

Refresh the current state data using the -refresh-only flag.

E.  

Update the current plan file using the terraform state push command.

Discussion 0
Questions 71

Which of these statements about Terraform Cloud workspaces is false?

Options:

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

Discussion 0
Questions 72

You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.

How will Terraform choose which version of the provider to use?

Options:

A.  

Terraform will use the version recorded in your lock file

B.  

Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources

C.  

Terraform will check your state file to determine the provider version to use

D.  

Terraform will use the latest version of the provider available at the time you provision your new resource

Discussion 0
Questions 73

What does Terraform use the .terraform.lock.hc1 file for?

Options:

A.  

There is no such file

B.  

Tracking specific provider dependencies

C.  

Preventing Terraform runs from occurring

D.  

Storing references to workspaces which are locked

Discussion 0
Questions 74

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.

Options:

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

Discussion 0
Questions 75

If one of your modules uses a local value, you can expose that value to callers of the module by defining a Terraform output in the module’s configuration.

Options:

A.  

True

B.  

False

Discussion 0
Questions 76

When should you run terraform init?

Options:

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.

Discussion 0
Questions 77

Which command doesnotcause Terraform to refresh its state?

Options:

A.  

terraform state list

B.  

terraform plan

C.  

terraform apply

D.  

terraform destroy

Discussion 0
Questions 78

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

Options:

A.  

Before the plan phase

B.  

During the plan phase

C.  

Before the apply phase

D.  

After the apply phase

Discussion 0
Questions 79

Terraform configuration can only import modules from the public registry.

Options:

A.  

True

B.  

False

Discussion 0
Questions 80

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

Options:

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

Discussion 0
Questions 81

When should you use the force-unlock command?

Options:

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

Discussion 0
Questions 82

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

Options:

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.

Discussion 0
Questions 83

What task does the terraform import command perform?

Options:

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.

Discussion 0
Questions 84

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 85

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

Options:

A.  

provider

B.  

state

C.  

data

D.  

resource

Discussion 0
Questions 86

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)?

Options:

A.  

Append pref=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

Discussion 0
Questions 87

Exhibit:

resource "kubernetes_namespace" "example" {

name = "test"

}

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

Options:

A.  

kubernetes_namespace.example,name

B.  

kubernetes_namespace.test.name

C.  

data.kubernetes_namespace.name

D.  

resource.kubernetes_namespace.example.name

Discussion 0
Questions 88

Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.

Options:

A.  

Plan

B.  

Import

C.  

Alidate

D.  

Init

E.  

apply

Discussion 0
Questions 89

You are creating a reusable Terraform configuration and want to include an optional billing_dept tag so your Finance team can track team-specific spending on resources. Which of the following billing_dept variable declarations will achieve this?

Options:

A.  

variable "billing_dept" { type = default}

B.  

variable "billing_dept" { default =}

C.  

variable "billing_dept" { type = optional(string)}

D.  

variable "billing_dept" { optional = true}

Discussion 0