Online Exam Quiz

questionQuestion  1 to 30

Which of the following is not a valid Terraform command?

  • terraform plan
  • terraform validate
  • terraform build
  • terraform apply
Mark for review

What is the purpose of the terraform.tfvars file?

  • Store variable definitions
  • Store provider configurations
  • Store resource definitions
  • Store backend configurations
Mark for review

What is the purpose of a provider in Terraform?

  • Define infrastructure
  • Provision resources
  • Define modules
  • Store state
Mark for review

How can you import existing infrastructure into Terraform?

  • terraform import
  • terraform include
  • terraform add
  • terraform link
Mark for review

How do you define a boolean variable in Terraform?

  • variable "bool" { type = bool }
  • var "bool" { type = boolean }
  • bool "variable" { type = bool }
  • define "bool" { type = bool }
Mark for review

How do you define a map variable in Terraform?

  • variable "map" { type = map }
  • var "map" { type = map }
  • map "variable" { type = map }
  • define "map" { type = map }
Mark for review

How do you define a resource in Terraform?

  • resource "type"
  • resource "name" "type"
  • resource "type" "name"
  • resource { "type" "name" }
Mark for review

How do you handle secrets in Terraform?

  • Store in .tfvars file
  • Use environment variables
  • Use Vault or a secret manager
  • Hardcode in configuration files
Mark for review

Which file format does Terraform primarily use for configuration?

  • YAML
  • JSON
  • HCL
  • XML
Mark for review

Which of the following is a valid Terraform backend?

  • S3
  • GCP
  • Azure
  • DigitalOcean
Mark for review

What does 'terraform output' command do?

  • Displays the output values
  • Validates the configuration
  • Applies the configuration
  • Initializes the configuration
Mark for review

How do you reference a variable in a Terraform configuration?

  • var.variable_name
  • $(variable_name)
  • ${var.variable_name}
  • ${variable_name}
Mark for review

Which syntax is used to define a condition in a resource block?

  • condition
  • if
  • count
  • depends_on
Mark for review

Which of the following is a valid way to reference a resource attribute?

  • resource.attribute
  • resource.name.attribute
  • resource["name"].attribute
  • resource.type.name.attribute
Mark for review

Which language is Terraform written in?

  • Python
  • Go
  • Ruby
  • Java
Mark for review

Which command shows the currently installed provider versions?

  • terraform providers
  • terraform show
  • terraform version
  • terraform info
Mark for review

Which backend does Terraform use by default for storing state?

  • S3
  • Local
  • GCS
  • Azure Blob
Mark for review

How do you specify a required provider version in Terraform?

  • version "1.0.0"
  • required_version = "1.0.0"
  • version = "1.0.0"
  • required_version "1.0.0"
Mark for review

What does the 'terraform validate' command do?

  • Validates the syntax
  • Executes the plan
  • Applies the configuration
  • Initializes the configuration
Mark for review

What is the default state file name in Terraform?

  • terraform.tf
  • terraform.tfstate
  • terraform.state
  • terraform.conf
Mark for review

How do you output values from a Terraform configuration?

  • output "value"
  • output { value }
  • output = "value"
  • output "value" {}
Mark for review

What does the 'terraform get' command do?

  • Downloads and installs modules
  • Downloads provider plugins
  • Initializes the configuration
  • Applies the configuration
Mark for review

What does the 'terraform taint' command do?

  • Marks a resource for recreation
  • Deletes a resource
  • Updates a resource
  • Imports a resource
Mark for review

How do you specify a list variable in Terraform?

  • variable "list" { type = list }
  • var "list" { type = list }
  • list "variable" { type = list }
  • define "list" { type = list }
Mark for review

Which command is used to format Terraform configuration files?

  • terraform style
  • terraform format
  • terraform fmt
  • terraform config
Mark for review

What is the purpose of the 'terraform workspace' command?

  • Manage multiple configurations
  • Manage different state files
  • Manage environments
  • All of the above
Mark for review

How do you rename a resource in the state file?

  • terraform state rename
  • terraform state mv
  • terraform state move
  • terraform rename
Mark for review

Which of the following is a valid resource definition?

  • resource "aws_instance" "example" { ... }
  • resource "example" "aws_instance" { ... }
  • resource "aws_instance" { "example" ... }
  • resource { "aws_instance" "example" ... }
Mark for review

How can you upgrade Terraform to a newer version?

  • terraform upgrade
  • terraform update
  • tf update
  • Download the new version manually
Mark for review

What is a module in Terraform?

  • A block of configuration
  • A reusable configuration package
  • A type of resource
  • A type of provider
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review