Summer Certification Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: force70

Pass the HashiCorp Terraform Associate Terraform-Associate-004 Questions and answers with CertsForce

Viewing page 9 out of 11 pages
Viewing questions 81-90 out of questions
Questions # 81:

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

Options:

A.

Terraform state list


B.

Terraform destroy


C.

Terraform validate


D.

Terraform validate


E.

Terraform for


F.

Terraform apply


Expert Solution
Questions # 82:

You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running the command terraform apply my.tfplan, you receive the error shown in the exhibit below.

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.

How can you apply the desired changes? (Choose TWO correct answers)

Options:

A.

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


B.

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


C.

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


D.

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


E.

Run terraform apply without the saved execution plan.


Expert Solution
Questions # 83:

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

Options:

A.

Provider


B.

Resource ID


C.

Resource address


D.

Path


Expert Solution
Questions # 84:

You’ve just finished refactoring part of your Terraform workspace’s configuration to use a module to manage some of your resources. When you plan your changes, you notice that Terraform will destroy and recreate the affected resources. Doing so could cause unintended downtime in the application your workspace manages. What supported approach should you take to complete the refactor without destroying and recreating your resources?

Options:

A.

Add moved blocks to your configuration to let Terraform know the new resource addresses for the affected resources.


B.

Run the terraform console command to edit your workspace ' s state and update the resource names.


C.

Manually edit your terraform.tfstate file and update the resource names.


D.

Open your cloud provider ' s console and rename the affected resources.


Expert Solution
Questions # 85:

You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource?

Original configuration:

resource " aws_s3_bucket " " photoes " {

bucket_prefix = " images "

}

Updated configuration:

resource " aws_s3_bucket " " photos " {

bucket_prefix = " images "

}

Options:

A.

moved {from = aws_s3_bucket.photoesto = aws_s3_bucket.photos}


B.

moved {bucket.photoes = aws_s3_bucket.photos}


C.

moved {aws_s3_bucket.photoes = aws_s3_bucket.photos}


D.

None. Terraform will automatically update the resource ID.


Expert Solution
Questions # 86:

What does terraform import do?

Options:

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


Expert Solution
Questions # 87:

You can execute terraform fmt to standardize all Terraform configurations within the current working directory to Terraform’s canonical format and style.

Options:

A.

True


B.

False


Expert Solution
Questions # 88:

Which statements are true? Choose two correct answers.

Options:

A.

When a resource has a count meta-argument, Terraform evaluates the precondition for each instance.


B.

A precondition cannot reference attributes of another resource that are only known after apply.


C.

A precondition in a resource block must pass for Terraform to create the resource.


D.

If a resource’s postcondition block fails, Terraform still creates the resources that depend on it.


Expert Solution
Questions # 89:

A module block used in your configuration is shown in the exhibit. You have been asked to update the version of this module from 4.2.1 to 5.0.0.

Exhibit:

module " compute " {

source = " Azure/compute/azurerm "

version = " 4.2.1 "

}

Which two steps must you take to accomplish this?

Options:

A.

Run the terraform init command.


B.

Run the terraform pull command.


C.

Update the version argument in the module block.


D.

Remove the version argument from the module block.


Expert Solution
Questions # 90:

You provisioned virtual machines (VMs) on Google Cloud Platform using the gcloud command-line tool.

What must be done to manage these VMs using Terraform instead? Pick the two correct responses.

Options:

A.

Pick the two correct responses below.


B.

Run terraform state pull.


C.

Add an import block to the configuration.


D.

Add a resource block for the existing VM.


E.

Run terraform apply -refresh-only.


Expert Solution
Viewing page 9 out of 11 pages
Viewing questions 81-90 out of questions