Independence Day Special Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 1b2718643m

TA-002-P Exam Dumps - HashiCorp Certified: Terraform Associate

Question # 4

You need to deploy resources into two different cloud regions in the same Terraform configuration. To do that, you declare multiple provider configurations as follows:

What meta-argument do you need to configure in a resource block to deploy the resource to the “us-west-2” AWS region?

A.

alias = west

B.

provider = west

C.

provider = aws.west

D.

alias = aws.west

Full Access
Question # 5

In contrast to Terraform Open Source, when working with Terraform Enterprise and Cloud Workspaces, conceptually you could think about them as completely separate working directories.

A.

True

B.

False

Full Access
Question # 6

Which of the following is not true of Terraform providers?

A.

Providers can be written by individuals

B.

Providers can be maintained by a community of users

C.

Some providers are maintained by HashiCorp

D.

Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers

E.

None of the above

Full Access
Question # 7

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (files). You need to enable debug messages to find this out.

Which of the following would achieve this?

A.

Set the environment variable TF_LOG=TRACE

B.

Set verbose logging for each provider in your Terraform configuration

C.

Set the environment variable TF_VAR_log=TRACE

D.

Set the environment variable TF_LOG_PATH

Full Access
Question # 8

What is the name assigned by Terraform to reference this resource?

A.

compute_instance

B.

main

C.

google

D.

test

Full Access
Question # 9

If a module declares a variable with a default, that variable must also be defined within the module.

A.

True

B.

False

Full Access
Question # 10

What is one disadvantage of using dynamic blocks in Terraform?

A.

They cannot be used to loop through a list of values

B.

Dynamic blocks can construct repeatable nested blocks

C.

They make configuration harder to read and understand

D.

Terraform will run more slowly

Full Access
Question # 11

What is the provider for this fictitious resource?

A.

vpc

B.

main

C.

aws

D.

test

Full Access
Question # 12

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.

A.

True

B.

False

Full Access
Question # 13

A Terraform local value can reference other Terraform local values.

A.

True

B.

False

Full Access
Question # 14

You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.

What will happen if you delete the VM using the cloud provider console, and run terraform apply again without changing any Terraform code?

A.

Terraform will remove the VM from state file

B.

Terraform will report an error

C.

Terraform will not make any changes

D.

Terraform will recreate the VM

Full Access
Question # 15

How is terraform import run?

A.

As a part of terraform init

B.

As a part of terraform plan

C.

As a part of terraform refresh

D.

By an explicit call

E.

All of the above

Full Access
Question # 16

Which of the following commands will launch the Interactive console for Terraform interpolations?

A.

terraform console

B.

terraform cli

C.

terraform

D.

terraform cmdline

Full Access
Question # 17

Provider dependencies are created in several different ways. Select the valid provider dependencies from the following list: (select three)

A.

Explicit use of a provider block in configuration, optionally including a version constraint.

B.

Use of any resource belonging to a particular provider in a resource or data block in configuration.

C.

Existence of any resource instance belonging to a particular provider in the current state.

D.

Existence of any provider plugins found locally in the working directory.

Full Access
Question # 18

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

A.

True

B.

False

Full Access
Question # 19

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

A.

Local values

B.

Dynamic blocks

C.

Count arguments

D.

Collection functions

Full Access
Question # 20

You have modified your Terraform configuration to fix a typo in the Terraform ID of a resource from aws_security_group.http to aws_security_group.http

Which of the following commands would you run to update the ID in state without destroying the resource?

terraform refresh

terraform apply

terraform mv aws-security-group.htp aws-security-group.http

Full Access
Question # 21

When you use a remote backend that needs authentication. HashrCorp recommends that you:

A.

Push your Tefraform configuration to an encrypted git repository

B.

Write the authentication credentials in the Terraform configuration files

C.

Use partial configuration to load the authentication credentials outside of the Terraform code

D.

Keep the Terraform configuration files in a secret store

Full Access
Question # 22

What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code? (select three)

A.

Requests for infrastructure or hardware required a ticket, increasing the time required to deploy applications

B.

Traditional deployment methods are not able to meet the demands of the modern business where resources tend to live days to weeks, rather than months to years

C.

Traditionally managed infrastructure can't keep up with cyclic or elastic applications

D.

Pointing and clicking in a management console is a scalable approach and reduces human error as businesses are moving to a multi-cloud deployment model

Full Access
Question # 23

True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp tools provides the ability to mask secrets in the terraform plan and state files.

A.

False

B.

True

Full Access
Question # 24

Terraform will sync all resources in state by default for every plan and apply, hence for larger infrastructures this can slow down terraform plan and terraform apply commands?

A.

False

B.

True

Full Access
Question # 25

As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provisioned is best to use in your Terraform code?

A.

local-exec

B.

file

C.

null-exec

D.

remote-exec

Full Access
Question # 26

Open source Terraform can only import publicly-accessible and open-source modules.

A.

True

B.

False

Full Access
Question # 27

Anyone can publish and share modules on the Terraform Public Module Registry, and meeting the requirements for publishing a module is extremely easy. Select from the following list all valid requirements. (select three)

A.

The module must be PCI/HIPPA compliant.

B.

Module repositories must use this three-part name format, terraform-- .

C.

The registry uses tags to identify module versions.

D.

Release tag names must be for the format x.y.z, and can optionally be prefixed with a v .

E.

The module must be on GitHub and must be a public repo.

Full Access
Question # 28

While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?

A.

JSON

B.

YAML

C.

TypeScript

D.

XML

Full Access
Question # 29

Which of the following is considered a Terraform plugin?

A.

Terraform language

B.

Terraform tooling

C.

Terraform logic

D.

Terraform provider

Full Access
Question # 30

Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors , and also check terraform apply to print the value as a temporary output for debugging purposes. What should be done to avoid this?

A.

Use terraform console command to have an interactive UI with full access to the underlying terraform state to run your interpolations , and debug at real-time.

B.

Add a breakpoint in your code, using the watch keyword , and output the value to console for temporary debugging.

C.

Use terraform zipmap function , it will be able to easily do the interpolations without complex code.

D.

Use terraform console command to have an interactive UI , but you can only use it with local state , and it does not work with remote state.

Full Access
Question # 31

Terraform init can indeed be run only a few times, because, every time terraform init will initialize the project , and download all plugins from the internet repository , regardless of whether they were present or not , and this increases the waiting time

A.

True

B.

False

Full Access
Question # 32

What is the standard workflow that a developer follows while working with terraform open source version?

A.

Run terraform refresh to update the terraform state , then write the terraform code , and finally run terraform apply.

B.

Run terraform destroy first since you need to start from fresh every time , before running terraform apply.

C.

Write terraform code , and run terraform push , to update the terraform state to the remote repo , which in turn will take care of the next steps.

D.

Write the terraform code on the developer machine , run terraform plan to check the changes , and run terraform apply to provision the infra.

Full Access
Question # 33

Refer to the below code where developer is outputting the value of the database password but has used sensitive parameter to hide the output value in the CLI.

output "db_password" { value = aws_db_instance.db.password description = "The password for logging in to the database." sensitive = true}

Since sensitive is set to true, the value associated with db password will not be present in state file as plain-text?

A.

False

B.

True

Full Access
Question # 34

What is the command you can use to set an environment variable named "var1"of type String?

A.

export TF_VAR_VAR1

B.

set TF_VAR_var1

C.

variable "var1" { type = "string"}

D.

export TF_VAR_var1

Full Access
Question # 35

You have created 2 workspaces PROD and RQA. You have switched to RQA and provisioned RQA infrastructure from this workspace. Where is your state file stored?

A.

terraform.tfstate.d

B.

terraform.d

C.

terraform.tfstate.RQA

D.

terraform.tfstate

Full Access
Question # 36

You want to use different AMI images for different regions and for the purpose you have defined following code block.

1.variable "images"

2.{

3. type = "map"

4.

5. default = {

6. us-east-1 = "image-1234"

7. us-west-2 = "image-4567"

8. us-west-1 = "image-4589"

9. }

10.}

What of the following approaches needs to be followed in order to select image-4589?

A.

var.images["us-west-1"]

B.

var.images[3]

C.

var.images[2]

D.

lookup(var.images["us-west-1"]

Full Access
Question # 37

You want to get involved in the development of Terraform. As this is an open source project, you would like to contribute a fix for an open issue of Terraform. What programming language will need to use to write the fix?

A.

It depends on which command issue related to.

B.

Python

C.

Go

D.

Java

Full Access
Question # 38

Please identify the offerings which are unique to Terraform Enterprise, and not available in either Terraform OSS, or Terraform Cloud. Select four.

A.

Audit Logs

B.

Private Network Connectivity

C.

VCS Integration

D.

Sentinel

E.

Clustering

Full Access
Question # 39

Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?

A.

terraform fmt

B.

terraform destroy

C.

terraform taint

D.

terraform refresh

Full Access
Question # 40

The Terraform language does not support user-defined functions, and so only the functions built in to the language are available for use.

A.

False

B.

True

Full Access
Question # 41

Environment variables can be used to set variables. The environment variables must be in the format "____"_. Select the correct prefix string from the following list.

A.

TF_CLI_ARGS

B.

TF_VAR

C.

TF_VAR_

D.

TF_VAR_ENV

Full Access
Question # 42

You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resources using Terraform?

A.

Run terraform refresh to ensure that the state file has the latest information for existing resources.

B.

Update the configuration file to include the new resources.

C.

Shut down or stop using the resources being imported so no changes are inadvertently missed.

D.

Modify the Terraform state file to add the new resources.

Full Access
Question # 43

terraform refresh command will not modify infrastructure, but does modify the state file.

A.

True

B.

False

Full Access
Question # 44

Which of the below are paid features of Terraform Cloud?

A.

Full API Coverage

B.

Secure variable Storage

C.

Roles/ Team management

D.

Cost Estimation

E.

Private Module Registry

F.

Sentinel policies

Full Access
Question # 45

If you enable TF_LOG = DEBUG, the log will be stored in syslog.log file in the currect directory.

A.

False

B.

True

Full Access
Question # 46

Hanah is writing a terraform configuration with nested modules, there are multiple places where she has to use the same conditional expression but she wants to avoid repeating the same values or expressions multiple times in the configuration,. What is a better approach to dealing with this?

A.

Expressions

B.

Local Values

C.

Variables

D.

Functions

Full Access
Question # 47

Your manager has instructed you to start using terraform for your day-to-day operations, but your security team is concerned about the terraform state files. They have heard it contains confidential information, and are worried that it will not be securely protected. What should be your response to the security team in this regard?

A.

Inform the security team that using terraform state is optional . There are ways to avoid it , and you will do the same.

B.

Ensure that the state is managed in a remote backend , preferably an enterprise grade state management system like Terraform Cloud.

C.

Mask the confidential entries in the terraform state file , using Vault Enterprise, another Hashicorp product , while keeping it locally.

D.

Keep the state file locally on each developer machine , and ensure that there is a local protection software like KeyPass protecting it.

Full Access
Question # 48

You have created an AWS EC2 instance of type t2.micro through your terraform configuration file ec2.tf . Now you want to change the instance type from t2.micro to t2.medium. Accordingly you have changed your configuration file and and ran terraform plan. After running terraform plan you check the output and saw one instance will be updated from t2.micro --> t2.medium. After this you went to grab a coffee without running terraform apply and meanwhile a member of your team changed the instance type of that EC2 instance to t2.medium from aws console. After coming to your desk you run terraform apply. What will happen?

A.

No resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 0 changed, 0 destroyed.

B.

The instance type will be changed to t2.micro and again will be changed to t2.medium

C.

terraform apply will through an error.

D.

1 resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 1 changed, 0 destroyed.

Full Access
Question # 49

Which of the below features of Terraform can be used for managing small differences between different environments which can act more like completely separate working directories.

A.

Repositories

B.

Workspaces

C.

Environment Variables

D.

Backends

Full Access
Question # 50

1. resource "aws_s3_bucket" "example" {

2. bucket = "my-test-s3-terraform-bucket"

3. …} resource "aws_iam_role" "test_role" {

4. name = "test_role"

5. …}

Due to the way that the application code is written, the s3 bucket must be created before the test role is created, otherwise there will be a problem. How can you ensure that?

A.

Add explicit dependency using depends_on . This will ensure the correct order of resource creation.

B.

This will already be taken care of by terraform native implicit dependency. Nothing else needs to be done from your end.

C.

This is not possible to control in terraform . Terraform will take care of it in a native way , and create a dependency graph that is best suited for the parallel resource creation.

D.

Create 2 separate terraform config scripts , and run them one by one , 1 for s3 bucket , and another for IAM role , run the S3 bucket script first.

Full Access
Question # 51

State locking does not happen automatically and must be specified at run

A.

False

B.

True

Full Access
Question # 52

Dawn has created the below child module. Without changing the module, can she override the instance_type from t2.micro to t2.large form her code while calling this module?

1. resource "aws_instance" "myec2"

2. {

3. ami = "ami-082b5a644766e0e6f"

4. instance_type = "t2.micro

5. }

A.

YES

B.

No

Full Access
Question # 53

Ric wants to enable detail logging and he wants highest verbosity of logs. Which of the following environment variable settings is correct option for him to select.

A.

Set TF_LOG = DEBUG

B.

Set VAR_TF = TRACE

C.

Set TF_LOG = TRACE

D.

Set VAR_TF_LOG = TRACE

Full Access
Question # 54

Jim has created several AWS resources from a single terraform configuration file. Someone from his team has manually modified one of the EC2 instance.

Now to discard the manual change, Jim wants to destroy and recreate the EC2 instance. What is the best way to do it?

A.

terraform recreate

B.

terraform taint

C.

terraform destroy

D.

terraform refresh

Full Access
Question # 55

Every region in AWS has a different AMI ID for Linux and these are keep on changing. What is the best approach to create the EC2 instances that can deal with different AMI IDs based on regions?

A.

Use data source aws_ami.

B.

Create a map of region to ami id.

C.

Create different configuration file for different region.

D.

None of the above

Full Access
Question # 56

In regards to Terraform state file, select all the statements below which are correct?

A.

When using local state, the state file is stored in plain-text.

B.

The state file is always encrypted at rest.

C.

Storing state remotely can provide better security.

D.

Using the mask feature, you can instruct Terraform to mask sensitive data in the state file.

E.

The Terraform state can contain sensitive data, therefore the state file should be protected from unauthorized access.

F.

Terraform Cloud always encrypts state at rest.

Full Access
Question # 57

What happens when a terraform apply command is executed?

A.

Creates the execution plan for the deployment of resources.

B.

Applies the changes required in the target infrastructure in order to reach the desired configuration.

C.

The backend is initialized and the working directory is prepped.

D.

Reconciles the state Terraform knows about with the real-world infrastructure.

Full Access