100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
HashiCorp: Terraform Associate (003) Practice Exam $10.99   Add to cart

Exam (elaborations)

HashiCorp: Terraform Associate (003) Practice Exam

 6 views  0 purchase
  • Course
  • HashiCorp
  • Institution
  • HashiCorp

A user runs terraform init on their RHEL-based server, and per the output, two provider plugins are downloaded: $ terraform init Initializing the backend... Initializing provider plugins... - Checking for available provider plugins... - Downloading plugin for provider "aws" (hashicorp/aws) 2...

[Show more]

Preview 3 out of 23  pages

  • August 26, 2024
  • 23
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • HashiCorp
  • HashiCorp
avatar-seller
TOPDOCTOR
HashiCorp Terraform Associate (003)
Practice Exam
A user runs terraform init on their RHEL-based server, and per the output,
two provider plugins are downloaded:

$ terraform init
Initializing the backend...
Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "aws" (hashicorp/aws) 2.44.0...
- Downloading plugin for provider "random" (hashicorp/random) 2.2.1...
Terraform has been successfully initialized!

Where are these plugins downloaded and stored on the server? - answer-The
.terraform/providers directory in the current working directory

When multiple arguments with single-line values appear on consecutive lines
at the same nesting level, HashiCorp recommends that you: - answer-align
the equals signs

When you add a new module to a configuration, Terraform must download it
before it can be used. What two commands can be used to download and
update modules? (select two) - answer-terraform init: This command
downloads and updates the required modules for the Terraform
configuration. It also sets up the backend for state storage if specified in the
configuration.

terraform get: This command is used to download and update modules for a
Terraform configuration. It can be used to update specific modules by
specifying the module name and version number, or it can be used to update
all modules by simply running the command without any arguments.

From the code below, identify the implicit dependency:

resource "aws_eip" "public_ip" {
vpc = true
instance = aws_instance.web_server.id
}
resource "aws_instance" "web_server" {
ami = "ami-2757f631"
instance_type = "t2.micro"
depends_on = [aws_s3_bucket.company_data]

,} - answer-The implicit dependency in the code is the EC2 instance labeled
"web_server" because the aws_eip resource depends on the
aws_instance.web_server.id for its instance attribute.

Terraform Cloud is more powerful when you integrate it with your version
control system (VCS) provider. Select all the supported VCS providers from
the answers below. (select four) - answer-GitHub Enterprise, Azure DevOps
Server, GitHub.com, Bitbucket Cloud

Which of the following statements represents the most accurate statement
about the Terraform language? - answer-Terraform is a mutable, imperative,
Infrastructure as Code provisioning language based on Hashicorp
Configuration Language, or optionally YAML.

In the example below, the depends_on argument creates what type of
dependency?

resource "aws_instance" "example" {
ami = "ami-2757f631"
instance_type = "t2.micro"
depends_on = [aws_s3_bucket.company_data]
} - answer-The `depends_on` argument in Terraform creates an explicit
dependency between resources. This means that Terraform will wait for the
specified resource to be created or updated before proceeding with the
dependent resource.

You are developing a new Terraform module to demonstrate features of the
most popular HashiCorp products. You need to spin up an AWS instance for
each tool, so you create the resource block as shown below using the
for_each meta-argument.

resource "aws_instance" "bryan-demo" {
# ...
for_each = {
"terraform": "infrastructure",
"vault": "security",
"consul": "connectivity",
"nomad": "scheduler",
}
}
After the deployment, you view the state using the terraform state list
command. What resource address would be displayed for the instance
related to vault? - answer-The correct resource address format for the
instance related to "vault" when using the for_each meta-argument in
Terraform is aws_instance.bryan-demo["vault"]. This format allows Terraform

, to uniquely identify and manage each instance based on the key-value pair
provided in the for_each block.

A user has created three workspaces using the command line - prod, dev,
and test. The user wants to create a fourth workspace named stage.
Which command will the user execute to accomplish this task? - answer-The
correct command to create a new workspace in Terraform is "terraform
workspace new ". This command will create a new workspace named "stage"
as requested by the user.

What do the declarations, such as name, cidr, and azs, in the following
Terraform code represent and what purpose do they serve?

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.7.0"
name = var.vpc_name
cidr = var.vpc_cidr
azs = var.vpc_azs
private_subnets = var.vpc_private_subnets
public_subnets = var.vpc_public_subnets
enable_nat_gateway = var.vpc_enable_nat_gateway
tags = var.vpc_tags
} - answer-these are variables that are passed into the child module likely
used for resource creation
Explanation
The declarations like name, cidr, and azs are variables that are being passed
into the child module for resource creation. These variables allow for
customization and flexibility in configuring the VPC module according to
specific requirements.

Emma is a Terraform expert, and she has automated all the things with
Terraform. A virtual machine was provisioned during a recent deployment,
but a local script did not work correctly. As a result, the virtual machine
needs to be destroyed and recreated.
How can Emma quickly have Terraform recreate the one resource without
having to destroy everything that was created? - answer-Using `terraform
apply -replace=aws_instance.web` allows Emma to mark the specific virtual
machine resource for replacement without affecting other resources that
were created. This command is useful for quickly recreating a single
resource.

In Terraform, most resource dependencies are handled automatically. Which
of the following statements best describes how Terraform resource
dependencies are handled? - answer-Terraform automatically analyzes
expressions within a resource block to identify dependencies on other

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller TOPDOCTOR. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83637 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.99
  • (0)
  Add to cart