ERASED TEST, YOU MAY BE INTERESTED ON HashiCorp Terraform TA-002-P Questions & Answer Part2/3
Title of test:
HashiCorp Terraform TA-002-P Questions & Answer Part2/3


Other tests from this author

Creation Date:

Category: Computers

Number of questions: 51
Share the Test:
New CommentNuevo Comentario
No comments about this test.
Question 1: Terraform requires GO as a pre-requisite for installation? A. True B. False.
Referring to the following terraform code, what is the local name for the resource that is defined? 1. resource "aws_instance" "instance-1" { 2. ami = "ami-082b5a644766e6e6f" 3. instance_type = "t2.micro" 4. count = 3 5. } A. aws_instance B. instance-1 C. ami-082b5a644766e0e6f D. t2.micro.
Alice has created a variable associated with the db_password parameter in the following way: var.db_password The value associated with the variable is defined in terraform.tfvars file in the following way: db_password="mypassword" Will the password be part of the terraform state file? A. True B. False.
Refer to the following map: 1. variable "vpc_cidrs" { 2. type = map 3. default = { 4. us-east-1 = "" 5. us-east-2 = "" 6. us-west-1 = "" 7. us-west-2 = "" 8. } How can we extract the value of the cidr range “” ? A. var.vpc_cidrs[2] B. var.vpc_cidrs[3] C. var.vpc_cidrs ["us-west-1"] D. var.vpc_cidrs[""].
What is the name of a file where all your infrastructure-related details managed by terraform is stored? A. terraform.state B. tfstate.terraform C. terraform.tfstate D. terraform.db.
Matthew is implementing Terraform in production. He realized that every region in AWS has a different AMI ID for Centos 7 OS. He wants to create a Terraform code that works for all the regions. He has already created the EC2 resource but needs to figure on how he can deal with different AMI IDs based on regions? What is the best approach? A. Create a map of the region to AMI ID. B. Create multiple TF files based on region and hardcode the AMI ID within the code. C. Make use of Data Source. D. None of the.
James is having an issue with his Terraform code. He wants to enable debugging. How can he do that? A. Set the VAR_TF=TRACE as an environment variable. B. Set TF_VAR_LOG=DEBUG as an environment variable. C. Set TF_VAR_LOG=TRACE as an environment variable. D. Set the TF_LOG=TRACE as an environment variable.
Which of the following command will export the debugging logs to a file named /tmp/terraform-crash.log? A. export TF_DEBUG_PATH=/tmp/terraform-crash.log B. export TF_LOG_FILE=/tmp/terraform-crash.log C. export TF_LOG_PATH=/tmp/terraform-crash.log D. None of the Above.
Refer to the following list: 1. variable "city_list" { 2. type = list default = ["new york", "london", "Frankfurt", "tokyo", "delhi"] 3. } How can the string of “Frankfurt” can be referred from a variable? A. var.city_list["Frankfurt"] B. var.city_list[3] C. var.city_list[2] D. None of the above.
Which of the following command will format your terraform code? A. terraform format B. terraform format myec2.tf C. terraform fmt D. terraform validate .
Terraform Plan validates the overall syntax of terraform code and will error if aspects like an undefined variable, missing arguments are part of the code? A. True B. False.
Which feature allows multiple state files for a single configuration file depending upon the environment? A. Terraform Modules B. Terraform Data Sources C. Terraform Environments D. Terraform Workspace.
Looking into the following code, what is the name of the provider that is being used? 1. resource "aws_instance" "myec2" { 2. ami = "ami-082b5a644766e6e6f" 3. instance_type = var.instancetype 4. } A. AWS_instance B. AWS C. myec2 D. None of the Above.
Can local value reference to another local value? A. True B. False .
Is defining the module version argument mandatory while pulling code from Terraform Registry? A. True B. False.
If the condition is met, what will the below resource deploy? 1. resource "aws_instance" "dev" { 2. ami = "ami-082b5a644766e6e6f" 3. instance_type = "t2.micro" 4. count = var.istest == true ? 3:0 5. } A. 0 Resources B. 3 Resources .
Refer to the following Terraform Code: 1. variable "elb_names" { 2. type = list 3. default = ["dev-loadbalancer", "stage-loadbalanacer","prod-loadbalancer"] 4. } 5. resource "aws_iam_user" "16" { 6. name = var.elb_names[count.index] 7. count = 2 8. path = "/system/" 9. } Base on this code, which IAM user name will not be created? A. dev-loadbalancer B. stage-loadbalanacer C. prod-loadbalancer1 .
Matthew is new to terraform. He is creating an EC2 instance. Matthew wants to IP address of the instance to show in output automatically once the EC2 instance is deployed? Which resource in terraform can he use ? A. provider B. outputs C. resource D. output .
A variable will need a value assigned in the following manner. Terraform Administrator needs to set a default value for the data type. What is the value that he can set? az=[“us-west-1a”,”us-west-1b”] A. string B. map C. list D. number .
Andrew wants to automatically extract the contents of the id_rsa.pub file present in the local directory and use it for creating EC2 instance? Which function can he use? A. extract B. file C. time D. unzip .
Refer to the following terraform 1. variable "tags" { 2. type = list 3. default = ["firstec2","secondec2","thirdec2"] 4. 5. tags= { 6. name = element(var.tags, count.index) 7. } If count.index is set to 1, which of the following values will be used ? A. firstec2 B. secondec2 C. thirdec2 .
Michaela is writing a module and within the module, there are multiple places where she has defined the same conditional expression. What is a better approach to dealing with this? A. variables B. functions C. local Values D. data Sources .
The following snippet is from the Terraform 0.11 version. Which of the below is the equivalent 0.12 version code? ${var.instance_types}" A. var.instance_type B. variable.instance_types C. var.instance_types D. None of the Above .
Which of the following state management command allow you to retrieve a list of resources that are part of the state file? A. terraform list B. terraform state read C. terraform state list D. terraform state overview .
Dario has created an EC2 instance via Terraform. Matthew has defined the following rules within the security group: Port 443 allowed from Port 22 allowed from John has added the following rule manually: Port 80 allowed from Next time when Matthew runs a terraform plan, what will happen? A. Terraform Plan will show everything is up to date. B. Terraform Plan will show output to remove the manually created rule. C. Terraform Plan will fail since some of the resources were created manually. D. None of the Above.
In which folder are the custom workspace state files are stored ? A. terraform B. terraform/workspace C. terraform.d D. terraform.d E. terraform.tfstate.d.
Dario has declared a variable name user_name in terraform configuration but missed defining the value associated with it. variable “user_name” {} On a terraform plan, will the output give an error since variable is not defined in code? A. True B. False.
Dario has decided to not use the terraform.tfvars file, instead, he wants to store all data into custom.tfvars file? Is it possible? A. Yes B. No.
Dario has decided to not use the terraform. tfvars file, instead, he wants to store all data into custom.tfvars file? How can he deal with this use-case while running terraform plan? A. terraform plan -var-file="custom.tfvars" B. terraform plan -var-state-file="custom.tfvars" C. terraform plan -state-file="custom.tfvars" D. None of the Above.
Provisioner block is within the resource configuration block in Terraform? A. True B. False.
A variable named instance_type has been undefined within the child module variable instance_type {} Will the root module be able to set that variable? A. True B. False.
Matthew has referred to a child module that has the following code. Can Matthew override the instance_type from t2.micro to t2.large form his code without touching the module? 1. resource "aws_instance" "myec2" { 2. ami = "ami-082b5a644766e0e6f" 3. instance_type = "t2.micro” 4. } A. Yes B. No.
The lookup function is used to refer to which data type? A. String B. Number C. Boolean D. Map.
John is an intern and he had recently created an EC2 instance manually. Can he import it in terraform without having to write a terraform configuration file for that EC2 instance from scratch? A. Yes B. Νο.
Matthew has written the configuration file of a manually created EC2 instance in Terraform. Following is the code: 1. resource "aws_instance" "myec2" { 2. ami = "ami-bf5540df" 3. instance_type = "t2.micro" 4. vpc_security_group_ids = ["sg-6ae7d613", "sg-53370035"] 5. key_name = "remotepractical" 6. subnet_id = "subnet -9e3cfbc5" 7. 8. tags { 9. Name = "manual" 10. } The instance id of that EC2 instance is “i-841886ebb7e9bd20” How he can import data of EC2 to state file? A. terraform import aws_instance.i-041886ebb7e9bd20 B. terraform import aws_instance.myec2 i-041886ebb7e9bd20 C. terraform import i-041886ebb7e9bd20 aws_instance.myec2 D. terraform import i-041886ebb7e9bd20 aws_instance.
Jessica has created a database instance in AWS and for ease of use is outputting the value of the database password with the following code: 1. output "db_password" { 2. value = local.db_password" 3. } Jessica wants to hide the output value in the CLI after terraform apply? What is the best way ? A. Use the encrypt function to encrypt the value. B. Make use of sensitive parameter C. Make use of a secure parameter. D. Make use of Hashing.
Following is the part of terraform code: 1. output "db_password" { 2. value = local.db_password" 3. sensitive = true 4. } As sensitive is set to true, will the value associated with db password be available in plain-text in the state file for everyone to read? A. True B. False.
What are the benefits of Providers in Terraform? A. Makes API interaction with the backend provider easier B. It allows us to encrypt data in transit. C. Provides an option for using multiple terraform functions. D. None of the Above.
Terraform allows users to create custom user-defined functions? A. True B. False.
Is the terraform destroy command the only way to destroy resources? A. True B. False.
Multiple provider instances blocks for AWS can be part of a single configuration file? A. True B. False.
After creating an EC2 instance, Yash wants to automatically install certain software packages like Nginx inside that EC2 instance. What is the way to achieve it? A. Make use of Local provisioner B. Make use of Remote provisioner C. Make use of Null provisioner D. Perform the installation part manually after EC2 instance is created.
You want to upgrade the provider version to the latest acceptable one. What is the approach to do it? A. terraform provider upgrade B. terraform init upgrade C. terraform init -upgrade D. Specify the new version under provider block do terraform init.
Matthew needs to make use of module within his terraform code. Should the module always be public and open-source to be able to be used? A. True B. False.
Supratik has joined a Security Architect in Enterprise Corp. He has mandated that all the Terraform configuration that creates an S3 bucket must have encryption feature enabled. What is the best way to achieve it? A. Review the S3 terraform code before terraform apply. B. Create a script that checks if the encryption parameter is enabled on every git commit. C. Make use of Sentinel Policies. D. Mandate S3 encryption within terraform policies.
If resources are deleted manually but were created through terraform, what will happen if terraform apply? A. Resources will be created again. B. Terraform will throw an error. C. No Modification will happen. D. None of the Above.
terraform refresh will update the state file?. A. True B. False.
Enterprise Corp has recently tied up with multiple small organization 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 Functions B. Conditional Expressions C. Spat Expressions D. Dynamic Blocks.
What is the system in which terraform plan and apply is happening remotely but the output is streamed locally called? A. Remote to Local Backends B. Remote Backends C. Local Backends D. Terraform Backends.
James has created a variable and has explicitly defined the type as a string. Following is the snippet: 1. variable "myvar" { 2. type = string 3. } Which of the following value will be accepted? A. 2 B. "2" C. Both of the above values. D. None of the above.
Alice has created 10 different AWS resources from a single terraform configuration file named large.tf Due to some manual modification to one of the EC2 instances, she wants to destroy and recreate the EC2 instance. What is the ideal way to achieve it? A. terraform destroy B. terraform recreate C. terraform taint D. Manually delete that EC2 instance and run terraform apply that will recreate the EC2 instance.
Report abuse