Infrastructure as Code (IaC) with TerraformTerraform fundamentalsCore Terraform workflowTerraform configurationTerraform modulesTerraform state managementMaintain infrastructure with TerraformHCP Terraform
You can run terraform fmt to format all Terraform configurations in the current working directory according to Terraform’s canonical format and style.
ATrue
BFalse
You have a Terraform configuration that defines one virtual machine, with no references to that VM. You ran terraform apply to create the resource and then removed its resource definition from the Terraform configuration file.
What occurs when you run terraform apply again in the working directory?
ATerraform will error.
BNothing will happen.
CTerraform will remove the virtual machine from the state file, but the resource will still exist.
DTerraform will destroy the virtual machine.
Which of the following arguments is required when declaring a Terraform output?
Adefault
Bvalue
Cdescription
Dsensitive
A data source appears in the Exhibit area of this page.
data "aws_ami" "web" \{
most_recent = true
owners = ["self"]
tags = \{
Name = "web-server"
\}
\}
How do you refer to this data source’s id attribute?
Adata.aws_ami.web.id
Bweb.id
Caws_ami.web.id
Ddata.web.id
QuestionQ6
Core Terraform workflow
0
Community Discussion
No comments yet. Be the first to start the discussion!
QuestionQ7
Terraform configuration
QuestionQ8
Terraform configuration
QuestionQ9
HCP Terraform
QuestionQ10
HCP Terraform
QuestionQ11
Terraform configuration
QuestionQ12
Terraform configuration
QuestionQ13
Core Terraform workflow
QuestionQ14
Terraform modules
QuestionQ15
Terraform fundamentals
QuestionQ16
Core Terraform workflow
QuestionQ17
Terraform state management
QuestionQ18
Core Terraform workflow
QuestionQ19
Core Terraform workflow
QuestionQ20
Terraform configuration
QuestionQ21
Terraform configuration
QuestionQ22
Terraform state management
QuestionQ23
HCP Terraform
QuestionQ24
Maintain infrastructure with Terraform
QuestionQ25
Terraform state management
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Ad
Want a break from the ads?
Go ad-free and unlock Learn Mode, Exam Mode, AstroTutor AI and every premium tool — everything you need to walk in prepared, and confident.
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
Save question
0
Community Discussion
No comments yet. Be the first to start the discussion!
As a developer, you want to make sure your plugins are current with the latest versions.
Which Terraform command should you run?
Aterraform apply -upgrade
Bterraform providers -upgrade
Cterraform init -upgrade
Dterraform refresh -upgrade
You are writing a Terraform configuration that invokes a child module. That child module defines an output value.
How can you make sure Terraform prints this value when you run Terraform CLI commands such as terraform apply?
ANothing. Terraform will automatically print out all output values from child modules.
BNothing. Terraform cannot use output values from child modules.
CDeclare a new output in your root configuration that references the module’s output.
DNone of these will print the value.
A resource block appears in the Exhibit space on this page.
resource "kubernetes_namespace" "example" \{
name = "test"
\}
How would you refer to this resource's name attribute in HCL?
Aresource.kubernetes_namespace.example.name
Bdata.kubernetes_namespace.name
Ckubernetes_namespace.example.name
Dkubernetes_namespace.test.name
Which capabilities do HCP Terraform workspaces offer that Terraform Community Edition does not?
Choose three
AAutomatic detection of common security issues.
BRemote execution of Terraform operations.
CSupport for multiple cloud providers.
DStore your configuration in a Version Control System (VCS).
EState versions and run history.
FStore Terraform and environment variables in variable sets.
You administer your HCP Terraform organization. Recently, an organization member accidentally applied a change to a workspace that manages infrastructure belonging to another team.
Which HCP Terraform features can you use to help avoid similar accidents in the future?
ACreate separate teams in HCP Terraform for each team in your organization, then assign project and/or workspace permissions to each team.
BConfigure your workspaces to use the VCS-driven workflow, then update permissions to each repository in your VCS.
CEnable two-factor authentication for your HCP organization, then limit access to only specific users within your organization.
DFor each workspace in your organization, edit its settings, and then assign only those users that are authorized to plan and apply changes to the workspace.
The Exhibit section on this page displays part of a configuration you have been asked to modify.
data "azurerm_resource_group" "example" \{
name = var.resource_group_name
\}
resource "azurerm_virtual_network" "example" \{
name = ____________________
\}
The Azure Virtual Network name must be the resource-group name, followed by a dash and the word “vnet”.
You need to retrieve the ID of an existing cloud resource for use in your Terraform configuration.
Which block type should you use?
Aresource
Bimport
Cdata
Doutput
A Terraform configuration produces errors when you run terraform plan.
How can you enable debug logging to investigate further?
ARerun terraform plan with the correct flag.
BEdit the client configuration file.
CUpdate the backend configuration.
DSet the correct environment variable.
If a module declares a variable with no default value, you must provide that variable’s value in the module block when calling the module in your configuration.
ATrue
BFalse
Which capabilities do Terraform providers provide?
Choose three
AGroup a collection of Terraform configuration files that map to a single state file.
BProvision resources for public cloud infrastructure services.
CInteract with cloud provider APIs.
DEnforce security and compliance policies.
EProvision resources for on-premises infrastructure services.
Terraform cannot use a newly configured cloud backend until it has been initialized by running terraform init.
ATrue
BFalse
When declaring a variable, setting the sensitive argument to true prevents its value from being stored in the state file.
ATrue
BFalse
terraform init creates an example main.tf file in the current directory.
ATrue
BFalse
What is the correct workflow for deploying new infrastructure using Terraform?
A
Write Terraform configuration.2. Run terraform apply to create infrastructure.3. Use terraform validate to confirm Terraform deployed resources correctly.
B
Write Terraform configuration.2. Run terraform init to initialize the working directory or workspace.3. Run terraform apply.
C
Write Terraform configuration.2. Run terraform plan to initialize the working directory or workspace.3. Run terraform apply to create the infrastructure.
D
Write Terraform configuration.2. Run terraform show to view proposed changes.3. Run terraform apply to create new infrastructure.
Your Terraform configuration declares a variable. You want to ensure its value satisfies your specific requirements and prevent the Terraform operation if it does not.
What should you add to the configuration?
AAdd a top-level check block.
BAdd a validation block to the variable block.
CAdd a top-level validation block.
DAdd a check block to the variable block.
A variable block is displayed in the Exhibit space on this page:
You will use this variable as the value of the tags argument in several resources. The data format must be a set of key-value pairs.
Which type argument should you use?
Atype = map(string)
Btype = any
Ctype = list(string)
Dtype = object({ tags = string})
What is the purpose of the .terraform directory in a Terraform workspace?
AThe directory contains plugins and modules that Terraform downloads during initialization, along with other important information.
BThe directory contains the provide credentials and the .tfvars files to prevent them from being committed to version control by accident.
CThe directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.
DThe directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.
Your team uses HCP Terraform to manage its infrastructure. You need to change an infrastructure stack that runs in a public cloud.
Which pattern best follows Infrastructure as Code practices when making the change?
AMake the change via the public cloud API endpoint.
BUse the public cloud console to make the change.
CRun the public cloud CLI tool to make the change.
DSubmit a pull request and wait for an approved merge of the change.
EClone the repository containing your infrastructure code and then run the code.
A senior administrator accidentally deleted some of your cloud instances.
What will Terraform do when you run terraform apply?
AStop and generate an error message about the missing instances.
BRebuild only the instances that were deleted.
CBuild a completely brand new set of infrastructure.
DTear down the entire workspace’s infrastructure and rebuild it.
When running terraform apply -refresh-only, which of the following does Terraform not consult when updating the state file?
AAuthentication credentials for the provider.
BTerraform configuration files defining the resources.
CThe actual infrastructure as reported by the provider API.
Community Discussion