Skip to content

Latest commit

 

History

History
92 lines (69 loc) · 2.65 KB

Question-Answer.md

File metadata and controls

92 lines (69 loc) · 2.65 KB

Sample Questions

Question 1

Usernames and passwords referenced in the Terraform code, even as variables, will end up in plain text in the state file.

Answer: True

Question 2

Consider the following Terraform 0.12 configuration snippet:
variable "vpc_cidrs" {
  type = map
  default = {
    us-east-1 = "10.0.0.0/16"
    us-east-2 = "10.1.0.0/16"
    us-west-1 = "10.2.0.0/16"
    us-west-2 = "10.3.0.0/16"
  }
}

resource "aws_vpc" "shared" {
  cidr_block = _____________
}

How would we define the cidr_block for us-east-1 in the aws_vpc resource using a variable?

Answer: var.vpc_cidrs[“us-east-1”]

Question 3

We have defined the values for our variables in the file terraform.tfvars, and saved it in the same directory as our Terraform configuration. Which of the following commands will use those values when creating an execution plan?
  • Incorrect: terraform plan
  • Incorrect: terraform plan -var-file=terraform.tfvars
  • Correct: All of the above
  • Incorrect: None of the above

Question 4

Which of the following Terraform commands will automatically refresh the state unless supplied with additional flags or arguments? Choose TWO correct answers.
  • Correct: terraform plan
  • Incorrect: terraform state
  • Correct: terraform apply
  • Incorrect: terraform validate
  • Incorrect: terraform output

Question 5

What happens when we apply Terraform configuration? Choose TWO correct answers.
  • Correct: Terraform makes any infrastructure changes defined in our configuration.
  • Incorrect: Terraform gets the plugins that the configuration requires.
  • Correct: Terraform updates the state file with any configuration changes it made.
  • Incorrect: Terraform corrects formatting errors in our configuration.
  • Incorrect: Terraform destroys and recreates all our infrastructure from scratch.

Question 6

Which flag is used to find more information about a Terraform command? For example, you need additional information about how to use the plan command. You would type: terraform plan _____. Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
  • -h
  • -help
  • --help

Return to README.md