Terraform
20 Questions
3 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which file extensions are used for Terraform configuration files?

  • hcl and json
  • tfvars and tf
  • json and tf
  • tf and tf.json (correct)
  • Which command is used to initialize a Terraform directory?

  • terraform apply
  • terraform init (correct)
  • terraform destroy
  • terraform plan
  • What is HCL used for in Terraform?

  • Creating declarations (correct)
  • Deploying resources
  • Deleting resources
  • Initializing a Terraform directory
  • What are the possible variable types in Terraform?

    <p>string, map, list</p> Signup and view all the answers

    What does the terraform.tfvars file do?

    <p>Declares essential values for resource provisioning</p> Signup and view all the answers

    What are the main files in a typical Terraform module?

    <p>main.tf, variables.tf, outputs.tf</p> Signup and view all the answers

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

    <p>Plan, apply, destroy</p> Signup and view all the answers

    What is the purpose of declaring variables in Terraform?

    <p>To provide values essential to resource provisioning</p> Signup and view all the answers

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

    <p>To provide additional information about the variable</p> Signup and view all the answers

    What takes precedence when setting variable values in Terraform?

    <p>The values set in the terraform.tfvars file</p> Signup and view all the answers

    Which of the following statements about Terraform outputs is correct?

    <p>Output values are a way to expose some of the attributes exported by Terraform resources to the user of a module.</p> Signup and view all the answers

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

    <p>To suppress values in CLI output.</p> Signup and view all the answers

    What are Terraform resources?

    <p>The most essential components of configuration files.</p> Signup and view all the answers

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

    <p>Specify explicit dependencies between resources.</p> Signup and view all the answers

    What does the tfstate file in Terraform do?

    <p>Keeps track of all resources.</p> Signup and view all the answers

    What can Terraform output values help you see?

    <p>The end values of the project.</p> Signup and view all the answers

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

    <p>To declare and export output values.</p> Signup and view all the answers

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

    <p>Values of output variables declared in the Terraform configuration.</p> Signup and view all the answers

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

    <p>The type and a local identifier as a string.</p> Signup and view all the answers

    What do Terraform resources allow users to declare?

    <p>The type of resource and all of the resource-specific settings.</p> Signup and view all the answers

    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

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    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.

    Use Quizgecko on...
    Browser
    Browser