Summer Sale Special - 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dm70dm

TA-002-P Questions and Answers

Question # 4

By default, provisioners that fail will also cause the Terraform apply itself to error. How can you change this default behavior within a provisioner?

A.

provisioner "local-exec" { on_failure = "next" }

B.

provisioner "local-exec" { when = "failure" terraform apply }

C.

provisioner "local-exec" { on_failure = "continue" }

D.

provisioner "local-exec" { on_failure = continue }

Full Access
Question # 5

Matt wants to import a manually created EC2 instance into terraform so that he can manage the EC2 instance through terraform going forward. He has written the configuration file of the EC2 instance before importing it to Terraform. Following is the code:

resource "aws_instance" "matt_ec2" { ami = "ami-bg2640de" instance_type = "t2.micro" vpc_security_group_ids = ["sg-6ae7d613", "sg-53370035"] key_name = "mysecret" subnet_id = "subnet-9e3cfbc5" }

The instance id of that EC2 instance is i-0260835eb7e9bd40 How he can import data of EC2 to state file?

A.

terraform import aws_instance.id = i-0260835eb7e9bd40

B.

terraform import i-0260835eb7e9bd40

C.

terraform import aws_instance.i-0260835eb7e9bd40

D.

terraform import aws_instance.matt_ec2 i-0260835eb7e9bd40

Full Access
Question # 6

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 # 7

Which of the below command will upgrade the provider version to the latest acceptable one?

A.

terraform plan upgrade

B.

terraform provider -upgrade

C.

terraform init -upgrade

D.

terraform init -update

Full Access
Question # 8

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 # 9

Select the operating systems which are supported for a clustered Terraform Enterprise: (select four)

A.

Unix

B.

Red Hat

C.

CentOS

D.

Amazon Linux

E.

Ubuntu

Full Access
Question # 10

Which command lets you experiment with Terraform's built-in functions?

A.

terraform env

B.

terraform console

C.

terraform test

D.

terraform validate

Full Access
Question # 11

terraform validate reports HCL syntax errors.

A.

True

B.

False

Full Access
Question # 12

While attempting to deploy resources into your cloud provider using Terraform. you begin to see some odd behavior and experience sluggish responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform's logging more verbose?

A.

TF_10G_PATM

B.

TF_LOG

C.

TF_10G_LEVEL

D.

TF.LOG.FUE

Full Access
Question # 13

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 # 14

How would you reference the attribute "name* of this fictitious resource in HCL?

A.

resource.kubrnetes_namespace>example.name

B.

kubernetes_namespace.test.name

C.

kubernetes_namespace.example,name

D.

data kubernetes_namespace.name

E.

None of the above

Full Access
Question # 15

What does this code do?

A.

Requires any version of the AWS provider > = 3.0 and < 4.0

B.

Requires any version of the AWS provider > = 3.0

C.

Requires any version of the AWS provider after the 3.0 major release like 4.1

D.

Requires any version of the AWS provider > 3.0

Full Access
Question # 16

Terraform is currently being used by your organisation to create resources on AWS for the development of a web application. One of your coworkers wants to change the instance type to "t2.large" while keeping the default set values.

What adjustments does the teammate make in order to meet his goal?

A.

Issue Terraform plan instance.type".t2.large" and it deploys the instance

B.

Modify the tf.variableswith the instance type and issue terraform apply

C.

Create a new file my.tfvars and add the type of the instance and issue terraform plan and apply

D.

Modify the terraform.tfvars with the instance type and issue terraform plan and then terraform apply to deploy the instances

Full Access
Question # 17

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 # 18

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 # 19

You have recently started a new job at a retailer as an engineer. As part of this new role, you have been tasked with evaluating multiple outages that occurred during peak shopping time during the holiday season. Your investigation found that the team is manually deploying new compute instances and configuring each compute instance manually. This has led to inconsistent configuration between each compute instance.

How would you solve this using infrastructure as code?

A.

Implement a ticketing workflow that makes engineers submit a ticket before manually provisioning and configuring a resource

B.

Implement a checklist that engineers can follow when configuring compute instances

C.

Replace the compute instance type with a larger version to reduce the number of required deployments

D.

Implement a provisioning pipeline that deploys infrastructure configurations committed to your version control system following code reviews

Full Access
Question # 20

What type of block is used to construct a collection of nested configuration blocks?

A.

for_each

B.

repeated

C.

nesting

D.

dynamic

Full Access
Question # 21

When should you use the force-unlock command?

A.

You see a status message that you cannot acquire the lock

B.

You have a high priority change

C.

Automatic unlocking failed

D.

Your apply failed due to a state lock

Full Access
Question # 22

You cannot publish your own modules on the Terraform Registry.

A.

False

B.

True

Full Access
Question # 23

You have been given requirements to create a security group for a new application. Since your organization standardizes on Terraform, you want to add this new security group with the fewest number of lines of code. What feature could you use to iterate over a list of required tcp ports to add to the new security group?

A.

dynamic backend

B.

splat expression

C.

terraform import

D.

dynamic block

Full Access
Question # 24

Your company has been using Terraform Cloud for a some time now . But every team is creating their own modules , and there is no standardization of the modules , with each team creating the resources in their own unique way . You want to enforce a standardization of the modules across the enterprise . What should be your approach.

A.

Create individual workspaces for each team , and ask them to share modules across workspaces.

B.

Implement a Private module registry in Terraform cloud , and ask teams to reference them.

C.

Upgrade to Terraform enterprise , since this is not possible in terraform cloud.

D.

Upload the modules in the terraform public module registry , and ask teams to reference them

Full Access
Question # 25

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 # 26

You have provisioned some aws resources in your test environment through Terraform for a POC work. After the POC, now you want to destroy the resources but before destroying them you want to check what resources will be getting destroyed through terraform. what are the options of doing that? (Select TWO)

A.

Use terraform destroy command

B.

This is not possible

C.

Use terraform plan command

D.

Use terraform plan -destroy command.

Full Access
Question # 27

What command should you run to display all workspaces for the current configuration?

A.

terraform workspace

B.

terraform workspace show

C.

terraform workspace list

D.

terraform show workspace

Full Access
Question # 28

Which of the following is allowed as a Terraform variable name?

A.

count

B.

name

C.

source

D.

version

Full Access
Question # 29

You have declared a variable called var.list which is a list of objects that all have an attribute id.

Which options will produce a list of the IDs? (Choose two.)

A.

{ for o in var.list : o => o.id }

B.

var.list[*].id

C.

[ var.list[*].id ]

D.

[ for o in var.list : o.id ]

Full Access
Question # 30

You just scaled your VM infrastructure and realized you set the count variable to the wrong value. You correct the value and save your change.

What do you do next to make your infrastructure match your configuration?

A.

Run an apply and confirm the planned changes

B.

Inspect your Terraform state because you want to change it

C.

Reinitialize because your configuration has changed

D.

Inspect all Terraform outputs to make sure they are correct

Full Access
Question # 31

A Terraform provisioner must be nested inside a resource configuration block.

A.

True

B.

False

Full Access
Question # 32

Terraform Cloud always encrypts state at rest and protects it with TLS in transit. Terraform Cloud also knows the identity of the user requesting state and maintains a history of state changes.

A.

False

B.

True

Full Access
Question # 33

You cannot publish your own modules on the Terraform Registry.

A.

False

B.

True

Full Access
Question # 34

You have a Terraform configuration file where a variable itemNum is defined as follows:

variable "itemNum" { default = 3}

You also have a defined the following environment variables in your shell: TF_itemNum =6, TF_VAR_itemNum =9. You also have a terraform.tfvars file with the following contents

itemNum = 7

When you run the following apply command, what is the value assigned to the itemNum variable?

terraform apply -var itemNum =4

A.

10

B.

6

C.

1

D.

4

E.

3

Full Access
Question # 35

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 # 36

When using Terraform in a team it is important for everyone to be working with the same state so that operations will be applied to the same remote objects. Which of the below option is a recommended solution for this?

A.

Remote State

B.

Module

C.

Use the cached state and treat this as the record of truth.

D.

Workspace

Full Access
Question # 37

The terraform state command can be used to ____

A.

Update current state

B.

Refresh existing state file

C.

Print the current state file in console

D.

It is not a valid command

Full Access
Question # 38

Multiple configurations for the same provider can be used in a single configuration file.

A.

False

B.

True

Full Access
Question # 39

ABC Enterprise has recently tied up with multiple small organizations for exchanging database information. Due to this, the firewall rules are increasing and are more than 100 rules. This is leading firewall configuration file that is difficult to manage. What is the way this type of configuration can be managed easily?

A.

Terraform Backends

B.

Terraform Functions

C.

Dynamic Blocks

D.

Terraform Expression

Full Access
Question # 40

terraform refresh will update the state file?

A.

True

B.

False

Full Access
Question # 41

lookup retrieves the value of a single element from which of the below data type?

A.

map

B.

set

C.

string

D.

list

Full Access
Question # 42

True or False: A list(...) contain a number of values of the same type while an object(...) can contain a number of values of different types.

A.

False

B.

True

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

John wants to use two different regions to deploy two different EC2 instances. He has specified two provider blocks in his providers.tf file.

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

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

When he run terraform plan he encountered an error. How to fix this?

A.

Use another provider version

B.

Use alias for region = "us-west-2"

C.

Use default keyword with region = "us-east-1"

D.

It can not be fixed

Full Access
Question # 45

You're preparing to install Terraform on client workstations and want to see which operating systems are supported. Which of the following operating systems is supported?

A.

Windows

B.

Amazon Linux

C.

FreeBSD

D.

Solaris

E.

MacOS

F.

All of the above

Full Access
Question # 46

How would you reference the Volume IDs associated with the ebs_block_device blocks in this configuration?

A.

aws_instance.example.ebs_block_device.[*].volume_id

B.

aws_instance.example.ebs_block_device.volume_id

C.

aws_instance.example.ebs_block_device[sda2,sda3].volume_id

D.

aws_instance.example.ebs_block_device.*.volume_id

Full Access
Question # 47

What is the best and easiest way for Terraform to read and write secrets from HashiCorp Vault?

A.

Vault provider

B.

API access using the AppRole auth method

C.

integration with a tool like Jenkins

D.

CLI access from the same machine running Terraform

Full Access
Question # 48

As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?

A.

terreform providers- upgrade

B.

terreform apply -upgrade

C.

terreform refresh -upgrade

D.

terreformn lnit -upgrade

Full Access
Question # 49

How can terraform plan aid in the development process?

A.

Validates your expectations against the execution plan without permanently modifying state

B.

Initializes your working directory containing your Terraform configuration files

C.

Formats your Terraform configuration files

D.

Reconciles Terraform’s state against deployed resources and permanently modifies state using the current status of deployed resources

Full Access
Question # 50

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 # 51

Which of the below configuration file formats are supported by Terraform? (Select TWO)

A.

Node

B.

JSON

C.

Go

D.

YAML

E.

HCL

Full Access
Question # 52

Provisioners should only be used as a last resort.

A.

False

B.

True

Full Access
Question # 53

Which of the following Terraform files should be ignored by Git when committing code to a repo? (select Three)

A.

Files named exactly terraform.tfvars or terraform.tfvars.json.

B.

Any files with names ending in .auto.tfvars or .auto.tfvars.json.

C.

input.tf

D.

terraform.tfstate

E.

output.tf

Full Access
Question # 54

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 # 55

When using remote state, state is only ever held in memory when used by Terraform.

A.

False

B.

True

Full Access
Question # 56

You want terraform plan and apply to be executed in Terraform Cloud's run environment but the output is to be streamed locally. Which one of the below you will choose?

A.

Local Backends

B.

This can be done using any of the local or remote backends

C.

Remote Backends

D.

Terraform Backends

Full Access
Question # 57

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 # 58

Which of the below options is the equivalent Terraform 0.12 version of the snippet which is written in Terraform 0.11?

"${var.instance_id}"

A.

variable.instance_id

B.

var.instance_ids

C.

var.instance_id

D.

None of the above

Full Access
Question # 59

Which type of block fetches or computes information for use elsewhere in a Terraform configuration?

A.

provider

B.

resource

C.

local

D.

data

Full Access
Question # 60

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?

A.

terraform refresh

B.

terraform apply

C.

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

Full Access
Question # 61

Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.

A.

True

B.

False

Full Access
Question # 62

When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)

A.

When a change is made to the resources via the Azure Cloud Console, the changes are recorded in a new state file

B.

When a change is made to the resources via the Azure Cloud Console, Terraform will update the state file to reflect them during the next plan or apply

C.

When a change is made to the resources via the Azure Cloud Console, the current state file will not be updated

D.

When a change is made to the resources via the Azure Cloud Console, the changes are recorded in the current state file

Full Access
Question # 63

Which of the following is not a valid string function in Terraform?

A.

split

B.

join

C.

slice

D.

chomp

Full Access
Question # 64

A single terraform resource file that defines an aws_instance resource can simple be renamed to azurerm_virtual_machine in order to switch cloud providers

A.

True

B.

False

Full Access
Question # 65

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 # 66

You would like to reuse the same Terraform configuration for your development and production environments with a different state file for each.

Which command would you use?

A.

terraform import

B.

terraform workspace

C.

terraform state

D.

terraform init

Full Access
Question # 67

Choose the answer that correctly completes the sentence: _______backends support state locking.

A.

All

B.

No

C.

Only local

D.

Some

Full Access
dumpsmate guaranteed to pass
24/7 Customer Support

DumpsMate's team of experts is always available to respond your queries on exam preparation. Get professional answers on any topic of the certification syllabus. Our experts will thoroughly satisfy you.

Site Secure

mcafee secure

TESTED 08 Jun 2023