Pre-Winter Sale 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 7 out of 12 pages
Viewing questions 61-70 out of questions
Questions # 61:

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


Expert Solution
Questions # 62:

You have a list of numbers representing the number of free CPU cores on each virtual cluster:

numcpus = [18, 3, 7, 11, 2]

Which Terraform built-in function would you use to select the largest number from the list?

Options:

A.

top(numcpus)


B.

max(numcpus)


C.

high[numcpus]


D.

ceil(numcpus)


Expert Solution
Questions # 63:

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.


Expert Solution
Questions # 64:

Exhibit:

provider " aws " { region = " us-east-1 " }

provider " aws " { region = " us-west-2 " }

You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?

Options:

A.

Add an alias to the us-west-2 provider (for example, alias = " west " ) and set provider = aws.west on resources that should use us-west-2.


B.

Rename the provider block to provider " aws " " west " { region = " us-west-2 " }.


C.

Create a new provider named provider " aws_west " { region = " us-west-2 " }.


D.

Nothing. Terraform will automatically decide which provider to use for each resource.


Expert Solution
Questions # 65:

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


Expert Solution
Questions # 66:

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.


Expert Solution
Questions # 67:

Exhibit:

module " web_stack " {

source = " ./modules/web_stack "

}

Your configuration defines the module block shown in the exhibit. The web_stack module accepts an input variable named servers. Which of the following changes to the module block sets the servers variable to the value of 3?

Options:

A.

module " web_stack " {source = " ./modules/web_stack " var.servers = 3}


B.

module " web_stack " {source = " ./modules/web_stack " inputs = { servers = 3 }}


C.

module " web_stack " {source = " ./modules/web_stack " servers = 3}


D.

module " web_stack " {source = " ./modules/web_stack " inputs.servers = 3}


Expert Solution
Questions # 68:

How can you enable verbose logging to troubleshoot Terraform?

Options:

A.

Set the log level command-line flag.


B.

Set the TF_LOG environment variable.


C.

Set the log level in your terraform block.


Expert Solution
Questions # 69:

Using the terraform state rm command against a resource will destroy it.

Options:

A.

True


B.

False


Expert Solution
Questions # 70:

Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.

Options:

A.

True


B.

False


Expert Solution
Viewing page 7 out of 12 pages
Viewing questions 61-70 out of questions