Terraform

VisionarySugilite avatar
VisionarySugilite
·
·
Download

Start Quiz

Study Flashcards

20 Questions

Which file extensions are used for Terraform configuration files?

tf and tf.json

Which command is used to initialize a Terraform directory?

terraform init

What is HCL used for in Terraform?

Creating declarations

What are the possible variable types in Terraform?

string, map, list

What does the terraform.tfvars file do?

Declares essential values for resource provisioning

What are the main files in a typical Terraform module?

main.tf, variables.tf, outputs.tf

What are the three main actions that Terraform can perform on its controlled environment?

Plan, apply, destroy

What is the purpose of declaring variables in Terraform?

To provide values essential to resource provisioning

What is the description field used for in a variable block?

To provide additional information about the variable

What takes precedence when setting variable values in Terraform?

The values set in the terraform.tfvars file

Which of the following statements about Terraform outputs is correct?

Output values are a way to expose some of the attributes exported by Terraform resources to the user of a module.

What is the purpose of the 'sensitive' argument in Terraform outputs?

To suppress values in CLI output.

What are Terraform resources?

The most essential components of configuration files.

What does the 'depends_on' field in Terraform resources allow you to do?

Specify explicit dependencies between resources.

What does the tfstate file in Terraform do?

Keeps track of all resources.

What can Terraform output values help you see?

The end values of the project.

What is the purpose of the 'output' block in Terraform modules?

To declare and export output values.

What type of information can be shown in the CLI output using Terraform outputs?

Values of output variables declared in the Terraform configuration.

What can be specified after the resource keyword in Terraform configuration files?

The type and a local identifier as a string.

What do Terraform resources allow users to declare?

The type of resource and all of the resource-specific settings.

Study Notes

Terraform Configuration Files

  • Terraform configuration files use .tf or .tf.json file extensions.

Terraform Initialization

  • The terraform init command is used to initialize a Terraform directory.

HCL in Terraform

  • HCL (HashiCorp Configuration Language) is used to write Terraform configuration files.

Variable Types in Terraform

  • Terraform supports several variable types, including:
    • String
    • Number
    • Bool
    • List
    • Map
    • Object
    • Null

Terraform.tfvars File

  • The terraform.tfvars file is used to set input variables for Terraform configurations.

Main Files in a Terraform Module

  • The main files in a typical Terraform module include:
    • main.tf
    • variables.tf
    • outputs.tf

Terraform Actions

  • Terraform can perform three main actions on its controlled environment:
    • Create
    • Update
    • Delete

Declaring Variables in Terraform

  • Declaring variables in Terraform allows users to:
    • Store and reuse values
    • Externalize configuration

Description Field in Variable Block

  • The description field in a variable block is used to provide a human-readable description of the variable.

Precedence of Variable Values

  • When setting variable values in Terraform, the following order of precedence applies:
    • Environment variables
    • terraform.tfvars file
    • *.auto.tfvars files
    • Command-line flags

Terraform Outputs

  • Terraform outputs can be used to:
    • Share data between modules
    • Display information to the user
  • Statements about Terraform outputs:
    • They are used to expose values from a Terraform module.
    • They can be accessed using the terraform output command.

Sensitive Argument in Terraform Outputs

  • The sensitive argument in Terraform outputs is used to:
    • Hide sensitive output values

Terraform Resources

  • Terraform resources represent infrastructure objects, such as:
    • Virtual machines
    • Databases
    • Network interfaces

Depends_on Field in Terraform Resources

  • The depends_on field in Terraform resources allows users to:
    • Specify resource dependencies

TFState File

  • The tfstate file is used to store the current state of the Terraform-managed infrastructure.

Terraform Output Values

  • Terraform output values can help users see:
    • Values of output variables
    • Resource attributes

Output Block in Terraform Modules

  • The purpose of the output block in Terraform modules is to:
    • Expose values from a Terraform module

CLI Output using Terraform Outputs

  • Terraform outputs can be used to display information in the CLI output, including:
    • Strings
    • Numbers
    • Lists
    • Maps

Resource Keyword in Terraform Configuration Files

  • After the resource keyword in Terraform configuration files, users can specify:
    • Resource types (e.g., aws_instance)
    • Resource names

Terraform Resources

  • Terraform resources allow users to declare:
    • Infrastructure components
    • Their properties

Test your knowledge on Terraform, a powerful CLI tool used for infrastructure as code. Learn about its key features, configuration files, and how to initialize a Terraform directory. Put your Terraform skills to the test with this informative quiz.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser