and Conceptual Actual Frequently Tested
Exam Questions With Reviewed 100% Correct
Detailed Answers
Guaranteed Pass!!Current Update!!
1. Which of the following commands will launch the Interactive console for
Terraform interpolations? - ANSWER terraform console
2. When using providers that require the retrieval of data, such as the
HashiCorp Vault provider, in what phase does Terraform actually retrieve
the data required? - ANSWER terraform init
resource "aws_s3_bucket" "example" {
bucket = "my-test-s3-terraform-bucket" ...
}
resource "aws_iam_role" "test_role" {
name = "test_role" ...
}
3. 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? - ANSWER Add explicit dependency using
depends_on . This will ensure the correct order of resource creation.
,5. Which of the below backends support state locking? - ANSWER - S3
- consul
- azurerm
6. Which of the following value will be accepted for my_var?
variable "my_var"
{
type = string
} - ANSWER - 15
- '15'
7. After creating a new workspace "PROD" you need to run the command
terraform select PROD to switch to it. - ANSWER False
8. 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? - ANSWER
Ensure that the state is managed in a remote backend, preferably an enterprise
grade state management system like Terraform Cloud.
,Terraform can run on Windows or Linux, but it requires a Server version of the
Windows operating system. - ANSWER False
How would you reference the "name" value of the second instance of this
fictitious resource?
resource "aws_instance" "web" {
count = 2
name = "terraform-${count.index}"
} - ANSWER aws_instance.web[1].name
Terraform providers are always installed from the Internet? - ANSWER False
Terraform provisioners can be added to any resource block? - ANSWER True
Complete the following sentence:For local state, the workspaces are stored
directly in a ___________. - ANSWER directory called terraform.tfstate.d
What is the name assigned by Terraform to reference this resource?
resource "azurerm_resource_group" "dev" {
name = "test"
location = "westus"
} - ANSWER test
A variable az has the following default value.
, What will be the datatype of the variable?
az=["us-west-1a","us-east-1a"] - ANSWER List
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? - ANSWER 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.
Provisioners should only be used as a last resort. - ANSWER True
The terraform.tfstate file always matches your currently built infrastructure. -
ANSWER False
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? - ANSWER -
Use terraform plan -destroy command.
- Use terraform destroy command
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.