ExamGecko
Home Home / HashiCorp / Terraform Associate 003

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

Question list
Search
Search

A module can always refer to all variables declared in its parent module.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: B

Explanation:

A module cannot always refer to all variables declared in its parent module, as it needs to explicitly declare input variables and assign values to them from the parent module's arguments. A module cannot access the parent module's variables directly, unless they are passed as input arguments.

You much initialize your working directory before running terraform validate.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: A

Explanation:

You must initialize your working directory before runningterraform validate, as it will ensure that all the required plugins and modules are installed and configured properly. If you skip this step, you may encounter errors or inconsistencies when validating your configuration files.

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: B

Explanation:

Runningterraform fmtwithout any flags in a directory with Terraform configuration files will not check the formatting of those files without changing their contents, but will actually rewrite them to a canonical format and style. If you want to check the formatting without making changes, you need to use the-checkflag.

The public Terraform Module Registry is free to use.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: A

Explanation:

The public Terraform Module Registry is free to use, as it is a public service that hosts thousands of self-contained packages called modules that are used to provision infrastructure. You can browse, use, and publish modules to the registry without any cost.

How do you specify a module's version when publishing it to the public terraform Module Registry?

A.
Configuration it in the module's Terraform code
A.
Configuration it in the module's Terraform code
Answers
B.
Mention it on the module's configuration page on the Terraform Module Registry
B.
Mention it on the module's configuration page on the Terraform Module Registry
Answers
C.
The Terraform Module Registry does not support versioning modules
C.
The Terraform Module Registry does not support versioning modules
Answers
D.
Tag a release in the associated repo
D.
Tag a release in the associated repo
Answers
Suggested answer: D

Explanation:

This is how you specify a module's version when publishing it to the public Terraform Module Registry, as it uses the tags from your version control system (such as GitHub or GitLab) to identify module versions. You need to use semantic versioning for your tags, such asv1.0.0.

Which method for sharing Terraform configurations fulfills the following criteria:

1. Keeps the configurations confidential within your organization

2. Support Terraform's semantic version constrains

3. Provides a browsable directory

A.
Subfolder within a workspace
A.
Subfolder within a workspace
Answers
B.
Generic git repository
B.
Generic git repository
Answers
C.
Terraform Cloud private registry
C.
Terraform Cloud private registry
Answers
D.
Public Terraform module registry
D.
Public Terraform module registry
Answers
Suggested answer: C

Explanation:

This is the method for sharing Terraform configurations that fulfills the following criteria:

Keeps the configurations confidential within your organization

Supports Terraform's semantic version constraints

Provides a browsable directory

The Terraform Cloud private registry is a feature of Terraform Cloud that allows you to host and manage your own modules within your organization, and use them in your Terraform configurations with versioning and access control.

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

A.
Cloned virtual machine images
A.
Cloned virtual machine images
Answers
B.
Versioned configuration files
B.
Versioned configuration files
Answers
C.
Change management database records
C.
Change management database records
Answers
D.
Doctor files
D.
Doctor files
Answers
Suggested answer: B

Explanation:

These are examples of infrastructure as code (IaC), which is a practice of managing and provisioning infrastructure through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.

Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

A.
Terraform state show ' provider_type_name
A.
Terraform state show ' provider_type_name
Answers
B.
Terraform state list
B.
Terraform state list
Answers
C.
Terraform get provider_type_name
C.
Terraform get provider_type_name
Answers
D.
Terraform state list provider_type_name
D.
Terraform state list provider_type_name
Answers
Suggested answer: A

Explanation:

This is the command that you would use to access all of the attributes and details of a resource managed by Terraform, by providing the resource address as an argument. For example,terraform state show 'aws_instance.example'will show you all the information about the AWS instance named example.

The_________determines how Terraform creates, updates, or delete resources.

A.
Terraform configuration
A.
Terraform configuration
Answers
B.
Terraform provisioner
B.
Terraform provisioner
Answers
C.
Terraform provider
C.
Terraform provider
Answers
D.
Terraform core
D.
Terraform core
Answers
Suggested answer: C

Explanation:

This is what determines how Terraform creates, updates, or deletes resources, as it is responsible for understanding API interactions with some service and exposing resources and data sources based on that API.

How does Terraform determine dependencies between resources?

A.
Terraform requires resource dependencies to be defined as modules and sourced in order
A.
Terraform requires resource dependencies to be defined as modules and sourced in order
Answers
B.
Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
B.
Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
Answers
C.
Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies
C.
Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies
Answers
D.
Terraform requires all dependencies between resources to be specified using the depends_on parameter
D.
Terraform requires all dependencies between resources to be specified using the depends_on parameter
Answers
Suggested answer: B

Explanation:

This is how Terraform determines dependencies between resources, by using the references between them in the configuration files and other factors that affect the order of operations.

Total 195 questions
Go to page: of 20