ExamGecko
Home Home / HashiCorp / Terraform Associate 003

HashiCorp Terraform Associate 003 Practice Test - Questions Answers, Page 20

Question list
Search
Search

Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.

A.

Automated infrastructure deployment visualization.

A.

Automated infrastructure deployment visualization.

Answers
B.

A web-based user interface (UI).

B.

A web-based user interface (UI).

Answers
C.

Automatic backups of configuration and state.

C.

Automatic backups of configuration and state.

Answers
D.

Remote state storage.

D.

Remote state storage.

Answers
Suggested answer: A, D

Explanation:

Automated Visualization: HCP Terraform provides visualization tools that map infrastructure configurations, helping users manage complex architectures.

Remote State Storage: Terraform Cloud offers remote state management, essential for teams working collaboratively on shared infrastructure, ensuring consistency and avoiding state conflicts.

For more information, consult Terraform Cloud and HCP Terraform features in the official documentation.

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

A.

Using the destroy command with auto-approve.

A.

Using the destroy command with auto-approve.

Answers
B.

Passing --destroy at the end of a plan request.

B.

Passing --destroy at the end of a plan request.

Answers
C.

Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.

C.

Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.

Answers
Suggested answer: B

Explanation:

Destroy Command Options: The terraform destroy command is the correct method to destroy resources, and it requires either manual approval or the -auto-approve flag.

Unsupported Triggering Method: The --destroy flag is not a recognized option for plan or apply commands, making B the correct answer as it is not a valid way to initiate resource destruction.

For more on destroying resources, refer to the terraform destroy command documentation in the Terraform CLI reference.


When you include a module block in your configuration that references a module from the Terraform Registry, the 'version' attribute is required.

A.

True

A.

True

Answers
B.

False

B.

False

Answers
Suggested answer: B

Explanation:

The 'version' attribute is optional when referencing a module from the Terraform Registry. If not specified, the latest version will be used, but it is often recommended to specify a version to ensure consistency across environments.

References:

Terraform Module Versioning

Your root module contains a variable named num_servers. Which is the correct way to pass its value to a child module with an input named servers?

A.

servers = num_servers

A.

servers = num_servers

Answers
B.

servers = var(num_servers)

B.

servers = var(num_servers)

Answers
C.

servers = var.num_servers

C.

servers = var.num_servers

Answers
D.

servers = ${var.num_servers}

D.

servers = ${var.num_servers}

Answers
Suggested answer: C

Explanation:

The correct syntax to pass a variable from the root module to a child module is servers = var.num_servers. Terraform uses dot notation to reference variables.

References:

Terraform Variables

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

resource 'aws_vpc' 'main' {

name = 'test'

}

A.

VPC

A.

VPC

Answers
B.

test

B.

test

Answers
C.

main

C.

main

Answers
D.

aws

D.

aws

Answers
Suggested answer: D

Explanation:

The provider for the aws_vpc resource is aws, as the resource type begins with aws_, which denotes that it is managed by the AWS provider.

References:

Terraform Providers

Total 195 questions
Go to page: of 20