For local state, the workspaces are stored directly in a ___________.
A. a file called terraform.tfstate.backup
B. directory called terraform.workspaces.tfstate
C. a file called terraform.tfstate
D. directory called terraform.tfstate.d
Correct Answer: D
For local state, Terraform stores the workspace states in a directory called terraform.tfstate.d. https://www.terraform.io/docs/state/workspaces.html#workspace-internals
Question 272:
Multiple configurations for the same provider can be used in a single configuration file.
A. False
B. True
Correct Answer: B
You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. The primary reason for this is to support multiple regions for a cloud platform; other examples include
targeting multiple Docker hosts, multiple Consul hosts, etc.
To include multiple configurations for a given provider, include multiple provider blocks with the same provider name, but set the alias meta-argument to an alias name to use for each additional configuration. For example:
# The default provider configuration
provider "aws" {
region = "us-east-1"
}
# Additional provider configuration for west coast region provider "aws" {
alias = "west"
region = "us-west-2"
}
The provider block without alias set is known as the default provider configuration. When alias is set, it creates an additional provider configuration. For providers that have no required configuration arguments, the implied empty configuration
is considered to be the default provider configuration.
Which of the below datatype is not supported by Terraform.
A. Array
B. List
C. Object
D. Map
Correct Answer: A
Question 274:
Multiple providers can be declared within a single Terraform configuration file.
A. True
B. False
Correct Answer: A
You can optionally define multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis. The primary reason for this is to support multiple regions for a cloud platform; other examples include
targeting multiple Docker hosts, multiple Consul hosts, etc.
To include multiple configurations for a given provider, include multiple provider blocks with the same provider name, but set the alias meta-argument to an alias name to use for each additional configuration.
For Example
# The default provider configuration
provider "aws" {
region = "us-east-1"
}
# Additional provider configuration for west coast region provider "aws" {
alias = "west"
region = "us-west-2"
}
The provider block without alias set is known as the default provider configuration. When alias is set, it creates an additional provider configuration. For providers that have no required configuration arguments, the implied empty configuration
is considered to be the default provider configuration.
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
Correct Answer: C
To upgrade to the latest acceptable version of each provider, run terraform init-upgrade. This command also upgrades to the latest versions of all Terraform modules. https://www.terraform.io/docs/configuration/providers.html
Question 276:
Once a resource is marked as tainted, the next plan will show that the resource will be _________ and ___________ and the next apply will implement this change.
A. recreated and tainted
B. destroyed and not recreated
C. tainted and not destroyed
D. destroyed and recreated
Correct Answer: D
Question 277:
After creating a new workspace "PROD" you need to run the command terraform select PROD to switch to it.
A. False
B. True
Correct Answer: A
By default, when you create a new workspace you are automatically switched to it To create a new workspace and switch to it, you can use terraform workspace new ; to switch to a existing workspace you can use
terraform workspace select ;
Example:
$ terraform workspace new example
Created and switched to workspace "example"!
You're now on a new, empty workspace. Workspaces isolate their state, so if you run "terraform plan" Terraform will not see any existing state for this configuration.
Question 278:
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. What command will do this?
A. terraform taint
B. terraform apply
C. terraform graph
D. terraform refresh
Correct Answer: A
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply. This command will not modify infrastructure, but does modify the state file in order to mark a resource as tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and recreated and the next apply will implement this change. Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different or rebooting the machine from a base image will cause new startup scripts to run. Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially new IP address of a tainted server. The plan command will show this if this is the case. This example will taint a single resource: $ terraform taint aws_security_group.allow_all The resource aws_security_group.allow_all in the module root has been marked as tainted.
https://www.terraform.io/docs/commands/taint.html
Question 279:
You have created two workspaces PROD and DEV. You have switched to DEV and provisioned DEV infrastructure from this workspace. Where is your state file stored?
A. terraform.d
B. terraform.tfstate
C. terraform.tfstate.DEV
D. terraform.tfstate.d
Correct Answer: D
Terraform stores the workspace states in a directory called terraform.tfstate.d. This directory should be treated similarly to default workspace state file terraform.tfstate main.tf provider.tf terraform.tfstate.d DEV terraform.tfstate # DEV workspace state file PROD terraform.tfstate # PROD workspace state file terraform.tfvars # Default workspace state file variables.tf
Question 280:
Your manager has instructed you to start using terraform for the entire infra provisioning of the application stack. There are 4 environments ?DEV , QA , UAT , and PROD. The application team has asked for complete segregation between these environments including the backend , state , and also configurations ,since there will be unique resources in different environments . What is the possible way to structure the terraform code to facilitate that.
A. Completely separate the working directories , keep one for each environment . For each working directory , maintain a separate configuration file , variables file , and map to a different backend.
B. Completely separate the working directories , keep one for each environment . For each working directory , maintain a separate configuration file , variables file , and map to the same backend.
C. Implement terraform workspaces , and map each environment with one workspace.
D. Enable remote backend storage . Configure 4 different backend storages , one for each environment.
Correct Answer: A
In particular, organizations commonly want to create a strong separation between multiple deployments of the same infrastructure serving different development stages (e.g. staging vs. production) or different internal teams. In this case, the backend used for each deployment often belongs to that deployment, with different credentials and access controls. Named workspaces are not a suitable isolation mechanism for this scenario. https://www.terraform.io/docs/state/ workspaces.html
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only HashiCorp exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your TA-002-P exam preparations and HashiCorp certification application, do not hesitate to visit our Vcedump.com to find your solutions here.