Spring Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

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

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

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.


Expert Solution
Questions # 82:

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.


Expert Solution
Questions # 83:

When declaring a variable, setting the sensitive argument to true will prevent the value from being stored in the state file.

Options:

A.

True


B.

False


Expert Solution
Questions # 84:

You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?

Options:

A.

After you run terraform apply so you can validate your infrastructure


B.

Before you run terraform apply so you can validate your provider credentials


C.

Before you run terraform plan so you can validate your code syntax


D.

After you run terraform plan so you can validate that your state file is consistent with your infrastructure


Expert Solution
Questions # 85:

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

Options:

A.

Cloned virtual machine images


B.

Versioned configuration files


C.

Change management database records


D.

Doctor files


Expert Solution
Questions # 86:

Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.

Options:

A.

A variable file


B.

Defined in Environment variables


C.

Inside the backend block within the Terraform configuration


D.

Defined in a connection configuration outside of Terraform


Expert Solution
Questions # 87:

Which of the following is not a valid string function in Terraform?

Options:

A.

chomp


B.

join


C.

slice


D.

split


Expert Solution
Questions # 88:

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.


Expert Solution
Questions # 89:

You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the resource you deployed?

Options:

A.

In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file


B.

Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address


C.

Run terraform output ip_address to view the result


D.

Run terraform destroy then terraform apply and look for the IP address in stdout


Expert Solution
Questions # 90:

You ' ve used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?

Options:

A.

Use the terraform state rm command to remove the VM from state file


B.

Use the terraform taint command targeting the VMs then run terraform plan and terraform apply


C.

Use the terraform apply command targeting the VM resources only


D.

Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply


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