Welcome to awslagi.com – Sharing AWS, Google Cloud, Microsoft Azure IT Exams. It's free for all!

TERRAFORM-ASSOCIATE-004: HashiCorp Certified: Terraform Associate (004)

Master the HashiCorp HashiCorp Certified: Terraform Associate (004) (TERRAFORM-ASSOCIATE-004) certification exam with 84 realistic practice questions covering HCP Terraform, Core Terraform workflow, Terraform state management, Terraform configuration.

4.8★★★★★(390 ratings)
19,316 studentsIntermediate
Prepare for the HashiCorp HashiCorp Certified: Terraform Associate (004) (TERRAFORM-ASSOCIATE-004) certification with scenario-based practice questions modeled on real exam objectives. You will build practical confidence across key domains including HCP Terraform, Core Terraform workflow, Terraform state management, Terraform configuration. Each question includes structured answer options and hint answers to help you identify knowledge gaps quickly, reinforce core HashiCorp concepts, and pass the TERRAFORM-ASSOCIATE-004 exam on your first attempt.

What you'll learn

  • HCP Terraform
  • Core Terraform workflow
  • Terraform state management
  • Terraform configuration
  • Terraform modules
  • Terraform fundamentals

TERRAFORM-ASSOCIATE-004

Lectures2
Questions84
Duration30 week
Students19,316

$20.00

Full Free Question Bank (84 Questions)

TERRAFORM-ASSOCIATE-004: HashiCorp Certified: Terraform Associate (004) (TERRAFORM-ASSOCIATE-004) Practice Questions & Verified Answers

Click any option to test your knowledge, or reveal the verified answer and detailed explanation below each question.

Jump to Section:
Question #1Part 1HCP Terraform

Which of the following statements about HCP Terraform workspaces is false?

AYou can trigger plans and applies using version control system integrations.
BHCP Terraform workspaces offer role-based access controls.
CYou must use the CLI to switch between workspaces.
DHCP Terraform workspaces can securely store cloud credentials.
Question #2Part 1Core Terraform workflow

You can runterraform fmtto format all Terraform configurations in the current working directory according to Terraform’s canonical format and style.

ATrue
BFalse
Question #3Part 1Terraform state management

You have a Terraform configuration that defines one virtual machine, with no references to that VM. You ranterraform applyto create the resource and then removed its resource definition from the Terraform configuration file. What occurs when you runterraform applyagain in the working directory?

ATerraform will error.
BNothing will happen.
CTerraform will remove the virtual machine from the state file, but the resource will still exist.
DTerraform will destroy the virtual machine.
Question #4Part 1Terraform configuration

Which of the following arguments is required when declaring a Terraform output?

Adefault
Bvalue
Cdescription
Dsensitive
Question #5Part 1Terraform configuration

A data source appears in the Exhibit area of this page. How do you refer to this data source’sidattribute? data "aws_ami" "web" \{ most_recent = true owners = ["self"] tags = \{ Name = "web-server" \} \}

Adata.aws_ami.web.id
Bweb.id
Caws_ami.web.id
Ddata.web.id
Question #6Part 1Core Terraform workflow

As a developer, you want to make sure your plugins are current with the latest versions. Which Terraform command should you run?

Aterraform apply -upgrade
Bterraform providers -upgrade
Cterraform init -upgrade
Dterraform refresh -upgrade
Question #7Part 1Terraform configuration

You are writing a Terraform configuration that invokes a child module. That child module defines an output value. How can you make sure Terraform prints this value when you run Terraform CLI commands such as `terraform apply`?

ANothing. Terraform will automatically print out all output values from child modules.
BNothing. Terraform cannot use output values from child modules.
CDeclare a new output in your root configuration that references the module’s output.
DNone of these will print the value.
Question #8Part 1Terraform configuration

A resource block appears in the Exhibit space on this page. How would you refer to this resource'snameattribute in HCL? resource "kubernetes_namespace" "example" \{ name = "test" \}

Aresource.kubernetes_namespace.example.name
Bdata.kubernetes_namespace.name
Ckubernetes_namespace.example.name
Dkubernetes_namespace.test.name
Question #9Part 1HCP TerraformSelect 3

Which capabilities do HCP Terraform workspaces offer that Terraform Community Edition does not? (Choose three.)

AAutomatic detection of common security issues.
BRemote execution of Terraform operations.
CSupport for multiple cloud providers.
DStore your configuration in a Version Control System (VCS).
EState versions and run history.
Question #10Part 1HCP Terraform

You administer your HCP Terraform organization. Recently, an organization member accidentally applied a change to a workspace that manages infrastructure belonging to another team. Which HCP Terraform features can you use to help avoid similar accidents in the future?

ACreate separate teams in HCP Terraform for each team in your organization, then assign project and/or workspace permissions to each team.
BConfigure your workspaces to use the VCS-driven workflow, then update permissions to each repository in your VCS.
CEnable two-factor authentication for your HCP organization, then limit access to only specific users within your organization.
DFor each workspace in your organization, edit its settings, and then assign only those users that are authorized to plan and apply changes to the workspace.
Question #11Part 1Terraform configuration

The Exhibit section on this page displays part of a configuration you have been asked to modify. ```hcl data "azurerm_resource_group" "example" \{ name = var.resource_group_name \} resource "azurerm_virtual_network" "example" \{ name = ____________________ \} ``` The Azure Virtual Network name must be the resource-group name, followed by a dash and the word “vnet”. Which expression meets this requirement? data "azurerm_resource_group" "example" \{ name = var.resource_group_name \} resource "azurerm_virtual_network" "example" \{ name = ____________________ \}

A“${azurerm_resource_group.example.name}-vnet”
Bjoin(“-”,var.resource_group_name,“vnet”)
Cconcat(data.azurerm_resource_group.example.name, “-”, “vnet”)
D“${data.azurerm_resource_group.example.name}-vnet”
Question #12Part 1Terraform configuration

You need to retrieve the ID of an existing cloud resource for use in your Terraform configuration. Which block type should you use?

Aresource
Bimport
Cdata
Doutput
Question #13Part 1Core Terraform workflow

A Terraform configuration produces errors when you runterraform plan. How can you enable debug logging to investigate further?

ARerun terraform plan with the correct flag.
BEdit the client configuration file.
CUpdate the backend configuration.
DSet the correct environment variable.
Question #14Part 1Terraform modules

If a module declares a variable with no default value, you must provide that variable’s value in the module block when calling the module in your configuration.

ATrue
BFalse
Question #15Part 1Terraform fundamentalsSelect 3

Which capabilities do Terraform providers provide? (Choose three.)

AGroup a collection of Terraform configuration files that map to a single state file.
BProvision resources for public cloud infrastructure services.
CInteract with cloud provider APIs.
DEnforce security and compliance policies.
EProvision resources for on-premises infrastructure services.
Question #16Part 1Core Terraform workflow

Terraform cannot use a newly configured cloud backend until it has been initialized by runningterraform init.

ATrue
BFalse
Question #17Part 1Terraform state management

When declaring a variable, setting thesensitiveargument totrueprevents its value from being stored in the state file.

ATrue
BFalse
Question #18Part 1Core Terraform workflow

terraform initcreates an examplemain.tffile in the current directory.

ATrue
BFalse
Question #19Part 1Core Terraform workflow

What is the correct workflow for deploying new infrastructure using Terraform?

A1. Write Terraform configuration.2. Run terraform apply to create infrastructure.3. Use terraform validate to confirm Terraform deployed resources correctly.
B1. Write Terraform configuration.2. Run terraform init to initialize the working directory or workspace.3. Run terraform apply.
C1. Write Terraform configuration.2. Run terraform plan to initialize the working directory or workspace.3. Run terraform apply to create the infrastructure.
D1. Write Terraform configuration.2. Run terraform show to view proposed changes.3. Run terraform apply to create new infrastructure.
Question #20Part 1Terraform configuration

Your Terraform configuration declares a variable. You want to ensure its value satisfies your specific requirements and prevent the Terraform operation if it does not. What should you add to the configuration?

AAdd a top-level check block.
BAdd a validation block to the variable block.
CAdd a top-level validation block.
DAdd a check block to the variable block.
Question #21Part 1Terraform configuration

A variable block is displayed in the Exhibit space on this page: You will use this variable as the value of thetagsargument in several resources. The data format must be a set of key-value pairs. Whichtypeargument should you use?

Atype = map(string)
Btype = any
Ctype = list(string)
Dtype = object({ tags = string})
Question #22Part 1Terraform state management

What is the purpose of the `.terraform` directory in a Terraform workspace?

AThe directory contains plugins and modules that Terraform downloads during initialization, along with other important information.
BThe directory contains the provide credentials and the .tfvars files to prevent them from being committed to version control by accident.
CThe directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.
DThe directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.
Question #23Part 1HCP Terraform

Your team uses HCP Terraform to manage its infrastructure. You need to change an infrastructure stack that runs in a public cloud. Which pattern best follows Infrastructure as Code practices when making the change?

AMake the change via the public cloud API endpoint.
BUse the public cloud console to make the change.
CRun the public cloud CLI tool to make the change.
DSubmit a pull request and wait for an approved merge of the change.
EClone the repository containing your infrastructure code and then run the code.
Question #24Part 1Maintain infrastructure with Terraform

A senior administrator accidentally deleted some of your cloud instances. What will Terraform do when you runterraform apply?

AStop and generate an error message about the missing instances.
BRebuild only the instances that were deleted.
CBuild a completely brand new set of infrastructure.
DTear down the entire workspace’s infrastructure and rebuild it.
Question #25Part 1Terraform state management

When runningterraform apply -refresh-only, which of the following does Terraformnotconsult when updating the state file?

AAuthentication credentials for the provider.
BTerraform configuration files defining the resources.
CThe actual infrastructure as reported by the provider API.
DThe most recent state file.
Question #26Part 1Terraform state management

Which command lets you view every attribute and detail of a resource managed by Terraform?

Aterraform get ‘provider_type.name’
Bterraform state show ‘provider_type.name’
Cterraform state list ‘provider_type.name’
Dterraform state list
Question #27Part 1Terraform configuration

When using multiple configurations for the same Terraform provider, which meta-argument must be included in every non-default provider configuration?

Aalias
Bname
Cdepends_on
Did
Question #28Part 1HCP TerraformSelect 2

You are responsible for infrastructure managed by two workspaces: `example-network` and `example-compute`. The `example-compute` workspace uses data from output values configured in the `example-network` workspace and must be deployed afterward. At present, this is a manual process: - An operator deploys changes to the `example-network` workspace. - They manually copy output values from the `example-network` workspace into input variables configured for the `example-compute` workspace. - They deploy the `example-compute` workspace. Which HCP Terraform features can automate this process? (Choose two.)

AA health check configured on the example-compute workspace to create a plan when HCP Terraform applies changes to the example-network workspace.
BA run trigger configured on the example-network workspace to automatically plan changes to the example-compute workspace after every apply.
CA health check configured on the example-network workspace to create a plan on the example-compute workspace when HCP Terraform applies changes to it.
DA run trigger configured on the example-compute workspace to automatically plan changes after HCP Terraform applies changes to the example-network workspace.
EA tfe_outputs data source configured in the example-compute workspace to automatically load output values from the example-network workspace.
Question #29Part 1Terraform modules

You are updating a child module that contains the following resource block in the Exhibit area on this page. The resource’spublic_ipattribute must be accessible from the parent module. How can you satisfy this requirement? resource “aws_instance” “example” \{ ami = “ami-0a123456789abcdef” instance_type = “t3.micro” \}

AAdd a data source to the parent module.
BCreate a local value in the child module.
CAdd an import block to the parent module.
DCreate an output in the child module.
Question #30Part 1Terraform configuration

How can verbose logging be enabled for troubleshooting?

ASet the log level command line flag.
BSet the TF_LOG environment variable.
CSet the log level in your terraform block.
Question #31Part 1Infrastructure as Code (IaC) with Terraform

Infrastructure as Code (IaC) can be kept in a version-control system together with application code.

ATrue
BFalse
Question #32Part 1Terraform state managementSelect 2

You want to import an existing database into Terraform management. What details are required to create a new import block for the database? (Choose two.)

AThe connection string that Terraform will use to connect and manage the database.
BThe ID associated with the current database on the cloud provider.
CThe database platform and version that is the existing resource is running.
DThe path to the .tf file that contains the database resource block.
EThe destination resource address of the block that will manage the database.
Question #33Part 1Core Terraform workflow

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

ATrue
BFalse
Question #34Part 1Terraform configuration

A resource block appears in the Exhibit area of this page. How do you refer to thenamevalue for the second instance of this resource? resource “aws_instance” “web” \{ count = 2 name = “terraform-$\{count.index\}” \}

Aaws_instance.web.*.name
Baws_instance.web[2].name
Celement(aws_instance.web, 2)
Daws_instance.web[1].name
Eaws_instance.web[1]
Question #35Part 1Terraform state management

You fixed a typo in a resource name, changing it from `aws_s3_bucket.photoes` to `aws_s3_bucket.photos`. You need to update the Terraform state so the existing resource is recognized by its new name, without destroying and recreating it. Which configuration should you use?

ARemove the old resource from your configuration and re-import it.
BRun terraform apply -refresh-only.
CDo nothing - Terraform will automatically update the state.
DAdd a moved block to your configuration.
Question #36Part 1HCP TerraformSelect 3

Where does HashiCorp recommend storing API tokens and other secrets in your team’s Terraform workspaces? (Choose three.)

AIn a terraform.tfvars file, checked into your version control system.
BIn an environment variable and referenced with TF_VAR_variablename.
CIn HashiCorp Vault.
DIn a plaintext document on a shared drive.
EIn an HCP Terraform variable, with the sensitive option checked.
Question #37Part 1Core Terraform workflow

After you approve the execution plan, what doesterraform applychange?

AThe state file
BThe cloud infrastructure
CThe execution plan
DThe Terraform code
EThe .terraform directory
Question #38Part 1Terraform configuration

You are developing a reusable Terraform configuration and want to add an optional `billing_dept` tag so that the Finance team can track team-specific resource spending. Which of the following `billing_dept` variable declarations accomplishes this?

Avariable “billing_dept” {default = “”}
Bvariable “billing_dept” {type = optional(string)}
Cvariable “billing_dept” {optional = true}
Dvariable “billing_dept” {type = default}
Question #39Part 1Infrastructure as Code (IaC) with Terraform

Which of the following workflows is enabled only through the use of Infrastructure as Code?

AAutomatic scaling of resources based on application load.
BCost optimization of infrastructure deployment.
CRole-based access control of cloud resources.
DReviewing the proposed changes for potential security issues.
Question #40Part 1Terraform configuration

The following resource block is displayed in the Exhibit space on this page: What is the Terraform resource name for this resource block? resource “google_compute_instance” “main” \{ name = “test” \}

Atest
Bcompute_instance
Cgoogle
Dmain
Question #41Part 1Core Terraform workflow

Which syntax check produces an error when you runterraform validate?

ANone of these will return an error.
BThere is a missing variable block.
CThe state file does not match the current infrastructure.
DThe code contains tabs for indentation instead of spaces.
Question #42Part 1Terraform state management

After performing your firstterraform apply, it is _________ to change the Terraform backend from the default local backend to another backend.

Adiscouraged
Bmandatory
Cimpossible
Doptional
Question #43Part 1Maintain infrastructure with Terraform

What is one advantage of immutable infrastructure?

AAutomatic infrastructure upgrades
BIn-place infrastructure upgrades
CQuicker infrastructure upgrades
DLess complex infrastructure upgrades
Question #44Part 1Core Terraform workflow

Which of the following can you do usingterraform plan?

ASchedule Terraform to run at a planned time in the future.
BView the execution plan and check if the changes match your expectations.
CExecute a plan in a different workspace.
DSave a generated execution plan to apply later.
Question #45Part 1Terraform state management

Which of the following is stored in the.terraformdirectory?

AProviders and modules
BLock file
CState file
DConfiguration files
Question #46Part 1Terraform configuration

Which of the following may be used as a Terraform variable name?

Aname
Bsource
Cversion
Dcount
Question #47Part 1Terraform configuration

Which of the following isnota valid Terraform collection type?

Aset
Blist
Cmap
Dtree
Question #48Part 1HCP Terraform

How does an HCP Terraform integration that uses the `cloud` block differ from remote backends such as S3?

AUsing the cloud block automatically encrypts state files at rest and in transit.
BUsing the cloud block requires using Terraform Enterprise.
CThe cloud block supports multiple backends simultaneously.
DUsing the cloud block enables remote operations on infrastructure managed by HCP Terraform or Terraform Enterprise.
Question #49Part 1Terraform configuration

Part of a configuration appears in the Exhibit space on this page. You need to pass the ID of thevsphere_datacenterdata source to thedatacenter_idargument of thevsphere_folderresource. Which reference would you use? data “vsphere_datacenter” “dc” \{\} resource “vsphere_folder” “parent” \{ path = “Production” type = “vm” datacenter_id = ____________________ \}

Adata.vsphere_datacenter.dc
Bdata.vsphere_datacenter.dc.id
Cvsphere_datacenter.dc.id
Ddata.dc.id
Question #50Part 1HCP Terraform

Which HCP Terraform feature helps you group similar workspaces and configure them collectively?

AVariable sets
BChange requests
CProjects
DPolicy sets
Question #51Part 1Core Terraform workflow

Which command must be executed before running a plan or apply for the first time?

Aterraform validate
Bterraform workspace
Cterraform import
Dterraform init
Question #52Part 1Terraform modules

A configuration includes a module block that references a module in the Terraform Registry and sets itsversionargument to1.0. You have published a new module version and updated the configuration to use version1.1. Which command must you run to install the new version?

Aterraform apply
Bterraform init
Cterraform plan
Dterraform modules
Question #53Part 1Terraform configuration

Which type of configuration block manages an infrastructure object using the settings specified in that block?

Adata
Blocals
Cprovider
Dresource
Question #54Part 1Core Terraform workflow

You created a new Terraform configuration for two virtual machines with a cloud provider. You are ready to create the infrastructure for the first time. Which Terraform command should you run first?

Aterraform apply
Bterraform plan
Cterraform init
Dterraform show
Question #55Part 1Core Terraform workflow

You have just scaled your VM infrastructure and discover that thecountvariable was set to an incorrect value. You correct that value and save the change. What must you do next so that your infrastructure matches the configuration?

AInspect your Terraform state because you want to change it.
BRun terraform apply and confirm the planned changes.
CInspect all Terraform outputs to make sure they are correct.
DReinitialize because your configuration has changed.
Question #56Part 1Terraform state managementSelect 2

You have a saved execution plan that contains intended changes for infrastructure managed by Terraform. After you run `terraform apply my.tfplan`, you receive the following error in the Exhibit space on this page: ```text 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. ``` How can you apply the intended changes? (Choose two.) 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.

AGenerate a new execution plan file with terraform plan, and apply the new plan.
BRun terraform apply without the saved execution plan.
CRefresh the current state data using the -refresh-only flag.
DForce the apply command by adding the flag -lock=false.
EUpdate the current plan file using the terraform state push command.
Question #57Part 1Terraform state management

What is one benefit of the Terraform state file?

AA state file can schedule recurring infrastructure tasks.
BA state file is the desired state expressed by the Terraform code files.
CA state file is a source of truth for resources provisioned with Terraform.
DA state file is a source of truth for resources provisioned with a public cloud console.
Question #58Part 1Infrastructure as Code (IaC) with TerraformSelect 2

In what ways does using Infrastructure as Code (IaC) improve the reliability of your infrastructure? (Choose two.)

AConfiguration drift is reduced with declarative definitions.
BUpdates are deployed with zero downtime.
CProposed changes can be reviewed before being applied.
DIncorrect configurations cannot be deployed.
EInfrastructure is automatically scaled to meet demand.
Question #59Part 1Terraform state management

State locking is supported by __________ backends.

AOnly local
BSome
CAll
DNo
Question #60Part 1Terraform state management

When should theforce-unlockcommand be used?

AWhen you see a status message stating that you cannot acquire the lock.
BWhen apply has failed due to a state lock.
CWhen automatic unlocking has failed.
DWhen you have a high priority change.
Question #61Part 2Terraform configuration

Other than in therequired_providersblock, Terraform configurations always reference providers using their local names.

ATrue
BFalse
Question #62Part 2Terraform state management

Terraform encrypts sensitive values that are stored in your state file.

ATrue
BFalse
Question #63Part 2Terraform configuration

When an assertion in a check block fails, Terraform prevents the current operation from executing.

ATrue
BFalse
Question #64Part 2Core Terraform workflow

Only the user who generated a Terraform plan may apply it.

ATrue
BFalse
Question #65Part 2Terraform configuration

You need to deploy resources to two different regions in the same Terraform configuration, using the block shown in the exhibit area on this page. ```hcl provider "aws" \{ region = "us-east-1" \} provider "aws" \{ region = "us-west-2" \} ``` What must you add to the provider configuration to deploy the resource to the `us-west-2` AWS Region? provider "aws" \{ region = "us-east-1" \} provider "aws" \{ region = "us-west-2" \}

Aresource “aws_instance” “example-us-west-2” {ami = data.aws_ami.ubuntu.idinstance_type = “t3.micro”}
Bprovider “aws” {region = “us-east-1”}provider “aws” “west” {region = “us-west-2”}
Cprovider “aws_west” {region = “us-west-2”}
Dprovider “aws” {region = “us-east-1”}provider “aws” {alias = “west”region = “us-west-2”}
Question #66Part 2Terraform modules

The configuration defines the module block displayed in the Exhibit area on this page. The `web_stack` module accepts an input variable called `servers`. ```hcl module "web_stack" \{ source = "./modules/web_stack" \} ``` Which change to the module block assigns the `servers` variable the value `3`? module "web_stack" \{ source = "./modules/web_stack" \}

Amodule “web_stack” {source = “./modules/web_stack”servers = 3}
Bmodule “web_stack” {source = “./modules/web_stack”inputs.servers = 3}
Cmodule “web_stack” {source = “./modules/web_stack”inputs = {servers = 3}
Dmodule “web_stack” {source = “./modules/web_stack”var.servers = 3}
Question #67Part 2HCP Terraform

Which HCP Terraform capability is recommended for using the same cloud-provider credentials across multiple workspaces?

AVariable sets
BVersion Control System (VCS) integration
CThe terraform_remote_state data source
Question #68Part 2Terraform fundamentals

What does Terraform use to deploy infrastructure across different cloud providers?

ACustom APIs developed by HashiCorp
BVendors’ CLI tools
CVendors’ UI
DVendor-specific providers
Question #69Part 2Terraform configuration

The configuration defines the following module block in the exhibit area of this page. This module defines an output calledhostnames. How can you access this output’s value?

Aproduction.hostnames
Bmodule.production.hostnames
Cweb_stack.hostnames
Dmodule.web_stack.hostnames
Question #70Part 2Terraform fundamentals

Which of the following isnota benefit of adopting Infrastructure as Code (IaC)?

AReusability of code
BAutomation
CA GUI (Graphical User Interface)
DVersioning
Question #71Part 2Terraform configuration

The following resource block is displayed in the Exhibit area of this page. What provider is used for this resource? resource “aws_vpc” “main” \{ name = “test” \}

Amain
Bvpc
Caws
Dtest
Question #72Part 2Terraform state management

Which Terraform command always triggers a state-file update for changes that may have occurred outside Terraform?

Aterraform plan -refresh-only
Bterraform show -json
Cterraform apply =lock=false
Dterraform plan -target=state
Question #73Part 2Terraform configuration

Terraform can manage resource dependencies only when you explicitly configure them with thedepends_onargument.

ATrue
BFalse
Question #74Part 2Infrastructure as Code (IaC) with Terraform

What is IaC (Infrastructure as Code) primarily intended to do?

ATo define a pipeline to test and deliver software.
BTo provision infrastructure cheaply.
CTo programmatically create and configure resources.
DTo define a vendor-agnostic API.
Question #75Part 2Core Terraform workflow

terraform initretrieves and caches the configuration for every remote module.

ATrue
BFalse
Question #76Part 2Terraform modules

When you runterraform apply, the Terraform CLI prints output values from both the root module and any child modules.

ATrue
BFalse
Question #77Part 2Terraform fundamentals

Runningterraform fmtwithout flags in a directory containing Terraform configuration files checks the formatting of those files, but never modifies them.

ATrue
BFalse
Question #78Part 2Terraform state management

After configuring a new Terraform backend in aterraformcode block, which command should you use to migrate the state file?

Aterraform init
Bterraform state rm
Cterraform push
Dterraform apply
Question #79Part 2Terraform configuration

You want to divide a large `main.tf` file into several files to improve organization within the same working directory. What effect should you expect when running `terraform plan`?

AThe terraform plan will fail since variable and provider blocks must appear before resource blocks.
BSignificant changes should be expected since moving resources between files can trigger a destroy/replacement.
CNo impact since Terraform reads all .tf files as a single configuration when executing a terraform plan.
DOnly minor impacts since Terraform parses the main.tf file first, which could change the order in which resources are created.
Question #80Part 2Core Terraform workflow

How does Terraform identify dependencies between resources when generating an execution plan?

ATerraform builds a resource graph based on your configuration and your state file (if present).
BTerraform requires resources in your configuration be listed in the order they will be created to determine dependencies.
CTerraform requires all dependencies between resources be specified using the depends_on parameter.
DTerraform requires resource dependencies be defined as modules and sourced in order.
Question #81Part 2Terraform fundamentals

Terraform requires a separate provider for every cloud provider where you plan to deploy resources.

ATrue
BFalse
Question #82Part 2Terraform state management

You must destroy every resource in your Terraform workspace exceptaws_instance.ubuntu[1], which you need to retain. How can you instruct Terraform to stop managing that particular resource without destroying it?

AChange the value of the count argument on the resource.
BRemove the resource block from your configuration.
CRun terraform state rm aws_instance.ubuntu[1].
DUse a moved block.
Question #83Part 2Core Terraform workflow

terraform validateverifies the syntax of Terraform files.

ATrue
BFalse
Question #84Part 2Terraform configuration

From which location can Terraformnotload a provider?

AProvider plugin cache
BSource code
COfficial HashiCorp distribution on releases.hashicorp.com
DPlugins directory

📢 Unlock Full Access to Success!

"The content displayed here is a promotional preview and contains only 50% of the actual exam database. To access the complete set of updated questions, please upgrade to the Full Version."

👉 Click the button and follow the instructions to secure your full access immediately!