ExamGecko
Home / HashiCorp / Terraform Associate 003 / List of questions
Ask Question

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

List of questions

Question 61

Report Export Collapse

Which of the following are advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

Prevents manual modifications to your resources
Prevents manual modifications to your resources
Lets you version, reuse, and share infrastructure configuration
Lets you version, reuse, and share infrastructure configuration
Secures your credentials
Secures your credentials
Provisions the same resources at a lower cost
Provisions the same resources at a lower cost
Reduces risk of operator error
Reduces risk of operator error
Suggested answer: B, E
Explanation:

Infrastructure as code (IaC) is a way of managing and provisioning cloud infrastructure using programming techniques instead of manual processes1. IaC has many advantages over using a graphical user interface (GUI) for provisioning infrastructure, such as:

* Versioning: IaC allows you to store your infrastructure configuration in a version control system, such as Git, and track changes over time. This enables you to roll back to previous versions, compare differences, and collaborate with other developers2.

* Reusability: IaC allows you to create reusable modules and templates that can be applied to different environments, such as development, testing, and production. This reduces duplication, improves consistency, and speeds up deployment3.

* Sharing: IaC allows you to share your infrastructure configuration with other developers, teams, or organizations, and leverage existing code from open source repositories or registries. This fosters best practices, innovation, and standardization4.

* Risk reduction: IaC reduces the risk of human error, configuration drift, and security breaches that can occur when provisioning infrastructure manually or using a GUI. IaC also enables you to perform automated testing, validation, and compliance checks on your infrastructure before deploying it5.

Reference =

* 1: What is Infrastructure as Code? Explained for Beginners - freeCodeCamp.org

* 2: The benefits of Infrastructure as Code - Microsoft Community Hub

* 3: Infrastructure as Code : Best Practices, Benefits & Examples - Spacelift

* 4: 5 Benefits of Infrastructure as Code (IaC) for Modern Businesses in the Cloud

* 5: The 7 Biggest Benefits of Infrastructure as Code - DuploCloud

asked 18/09/2024
FRANK THYS
40 questions

Question 62

Report Export Collapse

What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.

You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.
You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.
You can check out and check in cloud access keys
You can check out and check in cloud access keys
Sentinel Policies can be written in HashiCorp Configuration Language (HCL)
Sentinel Policies can be written in HashiCorp Configuration Language (HCL)
Policy-as-code can enforce security best practices
Policy-as-code can enforce security best practices
You can enforce a list of approved AWS AMIs
You can enforce a list of approved AWS AMIs
Suggested answer: A, D, E
Explanation:

Sentinel is a policy-as-code framework that allows you to define and enforce rules on your Terraform configurations, states, and plans1. Some of the benefits of using Sentinel with Terraform Cloud/Terraform Enterprise are:

* You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0, which would open up your network to the entire internet. This can help you prevent misconfigurations or security vulnerabilities in your infrastructure2.

* Policy-as-code can enforce security best practices, such as requiring encryption, authentication, or compliance standards. This can help you protect your data and meet regulatory requirements3.

* You can enforce a list of approved AWS AMIs, which are pre-configured images that contain the operating system and software you need to run your applications. This can help you ensure consistency, reliability, and performance across your infrastructure4.

Reference =

* 1: Terraform and Sentinel | Sentinel | HashiCorp Developer

* 2: Terraform Learning Resources: Getting Started with Sentinel in Terraform Cloud

* 3: Exploring the Power of HashiCorp Terraform, Sentinel, Terraform Cloud ...

* 4: Using New Sentinel Features in Terraform Cloud - Medium


asked 18/09/2024
Junaid Sahebzada
39 questions

Question 63

Report Export Collapse

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

True
True
False
False
Suggested answer: B
Explanation:

Terraform can manage resource dependencies implicitly or explicitly. Implicit dependencies are created when a resource references another resource or data source in its arguments. Terraform can infer the dependency from the reference and create or destroy the resources in the correct order. Explicit dependencies are created when you use thedepends_onargument to specify that a resource depends on another resource or module. This is useful when Terraform cannot infer the dependency from the configuration or when you need to create a dependency for some reason outside of Terraform's scope.Reference= :Create resource dependencies:Terraform Resource Dependencies Explained

asked 18/09/2024
Himal Rai
46 questions

Question 64

Report Export Collapse

Which provider authentication method prevents credentials from being stored in the state file?

Using environment variables
Using environment variables
Specifying the login credentials in the provider block
Specifying the login credentials in the provider block
Setting credentials as Terraform variables
Setting credentials as Terraform variables
None of the above
None of the above
Suggested answer: D
Explanation:

None of the above methods prevent credentials from being stored in the state file. Terraform stores the provider configuration in the state file, which may include sensitive information such as credentials. This is a potential security risk and should be avoided if possible. To prevent credentials from being stored in the state file, you can use one of the following methods:

Use environment variables to pass credentials to the provider. This way, the credentials are not part of the provider configuration and are not stored in the state file. However, this method may not work for some providers that require credentials to be set in the provider block.

Use dynamic credentials to authenticate with your cloud provider. This way, Terraform Cloud or Enterprise will request temporary credentials from your cloud provider for each run and use them to provision your resources. The credentials are not stored in the state file and are revoked after the run is completed. This method is supported for AWS, Google Cloud Platform, Azure, and Vault.Reference= : [Sensitive Values in State] :Authenticate providers with dynamic credentials

asked 18/09/2024
Vojtech Danek
41 questions

Question 65

Report Export Collapse

In Terraform HCL, an object type of object({name=string, age-number}) would match this value.

A)

HashiCorp Terraform Associate 003 image Question 65 30503 09182024192049000000

HashiCorp Terraform Associate 003 image Question 65 30503 09182024192049000000

C)

HashiCorp Terraform Associate 003 image Question 65 30503 09182024192049000000

D)

HashiCorp Terraform Associate 003 image Question 65 30503 09182024192049000000

Option A
Option A
Option B
Option B
Option C
Option C
Option D
Option D
Suggested answer: B
asked 18/09/2024
Quratulain Damani
43 questions

Question 66

Report Export Collapse

Which Terraform collection type should you use to store key/value pairs?

Set
Set
Map
Map
Tuple
Tuple
list
list
Suggested answer: B
Explanation:

The Terraform collection type that should be used to store key/value pairs ismap. A map is a collection of values that are accessed by arbitrary labels, called keys. The keys and values can be of any type, but the keys must be unique within a map. For example,var = { key1 = 'value1', key2 = 'value2' }is a map with two key/value pairs. Maps are useful for grouping related values together, such as configuration options or metadata.Reference= [Collection Types], [Map Type Constraints]

asked 18/09/2024
Yedron Rojas Acosta
51 questions

Question 67

Report Export Collapse

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?

The Terraform CD needs you to log into Terraform Cloud first
The Terraform CD needs you to log into Terraform Cloud first
Terraform requires you to manually run terraform plan first
Terraform requires you to manually run terraform plan first
Terraform needs to install the necessary plugins first
Terraform needs to install the necessary plugins first
Terraform needs you to format your code according to best practices first
Terraform needs you to format your code according to best practices first
Suggested answer: C
Explanation:

The reason why the apply fails after adding a new provider to the configuration and immediately runningterraform applyin the CD using the local backend is because Terraform needs to install the necessary plugins first. Terraform providers are plugins that Terraform uses to interact with various cloud services and other APIs. Each provider has a source address that determines where to download it from. When Terraform encounters a new provider in the configuration, it needs to runterraform initfirst to install the provider plugins in a local directory. Without the plugins, Terraform cannot communicate with the provider and perform the desired actions.Reference= [Provider Requirements], [Provider Installation]

asked 18/09/2024
Juliet Kihonge
48 questions

Question 68

Report Export Collapse

Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.

Plan
Plan
Import
Import
Alidate
Alidate
Init
Init
apply
apply
Suggested answer: D, E
Explanation:

The two steps that are required to provision new infrastructure in the Terraform workflow areinitandapply. Theterraform initcommand initializes a working directory containing Terraform configuration files. It downloads and installs the provider plugins that are needed for the configuration, and prepares the backend for storing the state. Theterraform applycommand applies the changes required to reach the desired state of the configuration, as described by the resource definitions in the configuration files. It shows a plan of the proposed changes and asks for confirmation before making any changes to the infrastructure.Reference= [The Core Terraform Workflow], [Initialize a Terraform working directory with init], [Apply Terraform Configuration with apply]

asked 18/09/2024
Carlos John Ricafort
46 questions

Question 69

Report Export Collapse

What is the name of the default file where Terraform stores the state?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Terraformtfstate
Terraformtfstate
Suggested answer: A
Explanation:

The name of the default file where Terraform stores the state isterraform.tfstate. This file contains a JSON representation of the current state of the infrastructure managed by Terraform. Terraform uses this file to track the metadata and attributes of the resources, and to plan and apply changes. By default, Terraform stores the state file locally in the same directory as the configuration files, but it can also be configured to store the state remotely in a backend.Reference= [Terraform State], [State File Format]

asked 18/09/2024
Joan Campo
40 questions

Question 70

Report Export Collapse

Which command add existing resources into Terraform state?

Terraform init
Terraform init
Terraform plan
Terraform plan
Terraform refresh
Terraform refresh
Terraform import
Terraform import
All of these
All of these
Suggested answer: D
Explanation:

This is the command that can add existing resources into Terraform state, by matching them with the corresponding configuration blocks in your files.

asked 18/09/2024
RYAN UBANA
46 questions
Total 195 questions
Go to page: of 20