Terraform Associate Exam 2024 | Over 300 Questions And Correct Answers
3 keer bekeken 0 keer verkocht
Vak
Terraform Associate
Instelling
Terraform Associate
Terraform Associate Exam 2024 | Over 300 Questions And Correct Answers
Which of the following commands will launch the Interactive console for Terraform interpolations?
terraform console
When using providers that require the retrieval of data, such as the HashiCorp Vault provider, in what phas...
Terraform Associate Exam 2024 | Over 300
Questions And Correct Answers
Which of the following commands will launch the Interactive console for
Terraform interpolations?
terraform console
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?
terraform init
resource "aws_s3_bucket" "example" {
bucket = "my-test-s3-terraform-bucket" ...
}
resource "aws_iam_role" "test_role" {
name = "test_role" ...
}
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?
Add explicit dependency using depends_on . This will ensure the correct order of
resource creation.
Which of the below backends support state locking?
- S3
- consul
- azurerm
Which of the following value will be accepted for my_var?
variable "my_var"
{
type = string
}
- 15
- '15'
After creating a new workspace "PROD" you need to run the command terraform
select PROD to switch to it.
False
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?
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.
,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}"
}
aws_instance.web[1].name
Terraform providers are always installed from the Internet?
False
Terraform provisioners can be added to any resource block?
True
Complete the following sentence:For local state, the workspaces are stored
directly in a ___________.
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"
}
test
A variable az has the following default value.
What will be the datatype of the variable?
az=["us-west-1a","us-east-1a"]
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?
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.
True
The terraform.tfstate file always matches your currently built infrastructure.
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?
- 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.
,What will happen if you delete the VM using the cloud provider console, and run
terraform apply again without changing any Terraform code?
Terraform will not make any changes
By default, provisioners that fail will also cause the Terraform apply itself to error.
How can you change this default behavior within a provisioner?
provisioner "local-exec" { on_failure = "continue" }
You should store secret data in the same version control repository as your
Terraform configuration.
False
What is the default backend for Terraform?
local
Talal is a DevOps engineer and he has deployed the production infrastructure
using Terraform. He is using a very large configuration file to maintain and
update the actual infrastructure.
As the infrastructure have grown to a very complex and large, he has started
experiencing slowness when he run runs terraform plan. What are the options for
him to resolve this slowness?
- Use -refresh=false flag as well as the -target flag with terraform plan in order to work
around this.
- Break large configurations into several smaller configurations that can each be
independently applied.
Which of the following represents a feature of Terraform Cloud that is NOT free to
customers?
Roles and Team Management
Your team has started using terraform OSS in a big way, and now wants to deploy
multi region deployments (DR) in aws using the same terraform files.
You want to deploy the same infra (VPC,EC2 ...) in both us-east-1 ,and us-west-2
using the same script , and then peer the VPCs across both the regions to enable
DR traffic. But , when you run your script , all resources are getting created in
only the default provider region. What should you do? Your provider setting is as
below -
# The default provider configuration provider "aws" { region = "us-east-1" }
Use provider alias functionality , and add another provider for us-west region . While
creating the resources using the tf script , reference the appropriate provider (using the
alias).
John is writing a module and within the module, there are multiple places where
he has to use the same conditional expression but he wants to avoid repeating
the same values or expressions multiple times in a configuration,. What is a
better approach to dealing with this?
Local Values
Terraform provisioner must be nested inside a resource configuration block.
True
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?
Dynamic Blocks
What are some of the problems of how infrastructure was traditionally managed
before Infrastructure as Code?
- 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
- Traditionally managed infrastructure can't keep up with cyclic or elastic applications
- Requests for infrastructure or hardware required a ticket, increasing the time required
to deploy applications
You have configured an Auto Scaling group in AWS to automatically scale the
number of instances behind a load balancer based on the instances CPU
utilization. The instances are configured using a Launch Configuration. You have
observed that the Auto Scaling group doesn't successfully scale when you apply
changes that require replacing the Launch Configuration. Why is this happening?
You need to configure the Launch Configuration's create_before_destroy meta-
parameter.
The terraform init command is always safe to run multiple times, to bring the
working directory up to date with changes in the configuration. Though
subsequent runs may give errors, this command will never delete your existing
configuration or state.
True
Terraform Enterprise currently supports running under which the following
operating systems?
- Ubuntu
- Amazon Linux
- Debian
- CentOS
- Red Hat Enterprise Linux
- Oracle Linux
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:
provider "aws" {
region = "us-east-1"
}
provider "aws" {
alias = "west"
region = "us-west-2"
}
What meta-argument do you need to configure in a resource block to deploy the
resource to the "us-west-2" AWS region?
alias = west
Which of the following clouds does not have a provider maintained by Hashicorp
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper LectDan. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €8,82. Je zit daarna nergens aan vast.