Skip to content

Instantly share code, notes, and snippets.

@ciberado
Created March 24, 2023 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciberado/6e674eff594074a8d9e6db347cb673f5 to your computer and use it in GitHub Desktop.
Save ciberado/6e674eff594074a8d9e6db347cb673f5 to your computer and use it in GitHub Desktop.
[
{
"text": "The terraform.tfstate file always matches your currently built infrastructure.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "One remote backend configuration always maps to a single remote workspace.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?",
"responses": [
{
"letter": "A. ",
"text": "It can execute Terraform runs on dedicated infrastructure on premises or in Terraform Cloud",
"correct": true
},
{
"letter": "B. ",
"text": "It doesn't show the output of a terraform apply locally",
"correct": false
},
{
"letter": "C. ",
"text": "It is only available to paying customers",
"correct": false
},
{
"letter": "D. ",
"text": "All of the above",
"correct": false
}
]
},
{
"text": "What is the workflow for deploying new infrastructure with Terraform?",
"responses": [
{
"letter": "A. ",
"text": "terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.",
"correct": false
},
{
"letter": "B. ",
"text": "Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.",
"correct": false
},
{
"letter": "C. ",
"text": "terraform import to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.",
"correct": false
},
{
"letter": "D. ",
"text": "Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.",
"correct": true
}
]
},
{
"text": "A provider configuration block is required in every Terraform configuration.\nExample:",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "The terraform.tfstate file always matches your currently built infrastructure.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "One remote backend configuration always maps to a single remote workspace.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?",
"responses": [
{
"letter": "A. ",
"text": "It can execute Terraform runs on dedicated infrastructure on premises or in Terraform Cloud",
"correct": true
},
{
"letter": "B. ",
"text": "It doesn't show the output of a terraform apply locally",
"correct": false
},
{
"letter": "C. ",
"text": "It is only available to paying customers",
"correct": false
},
{
"letter": "D. ",
"text": "All of the above",
"correct": false
}
]
},
{
"text": "What is the workflow for deploying new infrastructure with Terraform?",
"responses": [
{
"letter": "A. ",
"text": "terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.",
"correct": false
},
{
"letter": "B. ",
"text": "Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.",
"correct": false
},
{
"letter": "C. ",
"text": "terraform import to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.",
"correct": false
},
{
"letter": "D. ",
"text": "Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.",
"correct": true
}
]
},
{
"text": "A provider configuration block is required in every Terraform configuration.\nExample:",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "Which of the following is not a key principle of infrastructure as code?",
"responses": [
{
"letter": "A. ",
"text": "Versioned infrastructure",
"correct": false
},
{
"letter": "B. ",
"text": "Golden images",
"correct": true
},
{
"letter": "C. ",
"text": "Idempotence",
"correct": false
},
{
"letter": "D. ",
"text": "Self-describing infrastructure",
"correct": false
}
]
},
{
"text": "Terraform variables and outputs that set the \"description\" argument will store that description in the state file.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "What is the provider for this fictitious resource?",
"responses": [
{
"letter": "A. ",
"text": "vpc",
"correct": false
},
{
"letter": "B. ",
"text": "main",
"correct": false
},
{
"letter": "C. ",
"text": "aws",
"correct": true
},
{
"letter": "D. ",
"text": "test",
"correct": false
}
]
},
{
"text": "If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?",
"responses": [
{
"letter": "A. ",
"text": "Run terraform refresh",
"correct": true
},
{
"letter": "B. ",
"text": "It will happen automatically",
"correct": false
},
{
"letter": "C. ",
"text": "Manually update the state fire",
"correct": false
},
{
"letter": "D. ",
"text": "Run terraform import",
"correct": false
}
]
},
{
"text": "What is not processed when running a terraform refresh?",
"responses": [
{
"letter": "A. ",
"text": "State file",
"correct": false
},
{
"letter": "B. ",
"text": "Configuration file",
"correct": true
},
{
"letter": "C. ",
"text": "Credentials",
"correct": false
},
{
"letter": "D. ",
"text": "Cloud provider",
"correct": false
}
]
}
,
{
"text": "What information does the public Terraform Module Registry automatically expose about published modules?",
"responses": [
{
"letter": "A. ",
"text": "Required input variables",
"correct": false
},
{
"letter": "B. ",
"text": "Optional inputs variables and default values",
"correct": false
},
{
"letter": "C. ",
"text": "Outputs",
"correct": false
},
{
"letter": "D. ",
"text": "All of the above",
"correct": true
},
{
"letter": "E. ",
"text": "None of the above",
"correct": false
}
]
},
{
"text": "If a module uses a local values, you can expose that value with a terraform output.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "You should store secret data in the same version control repository as your Terraform configuration.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "Which of the following is not a valid string function in Terraform?",
"responses": [
{
"letter": "A. ",
"text": "split",
"correct": false
},
{
"letter": "B. ",
"text": "join",
"correct": false
},
{
"letter": "C. ",
"text": "slice",
"correct": true
},
{
"letter": "D. ",
"text": "chomp",
"correct": false
}
]
},
{
"text": "You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with\nTerraform and want to manage these VMs using Terraform instead.\nWhat are the two things you must do to achieve this? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "Provision new VMs using Terraform with the same VM names",
"correct": false
},
{
"letter": "B. ",
"text": "Use the terraform import command for the existing VMs",
"correct": true
},
{
"letter": "C. ",
"text": "Write Terraform configuration for the existing VMs",
"correct": true
},
{
"letter": "D. ",
"text": "Run the terraform import-gcp command",
"correct": false
}
]
}
,
{
"text": "You have recently started a new job at a retailer as an engineer. As part of this new role, you have been tasked with evaluating multiple outages that occurred during peak shopping time during the holiday season. Your investigation found that the team is manually deploying new compute instances and configuring each compute instance manually. This has led to inconsistent configuration between each compute instance.\nHow would you solve this using infrastructure as code?",
"responses": [
{
"letter": "A. ",
"text": "Implement a ticketing workflow that makes engineers submit a ticket before manually provisioning and configuring a resource",
"correct": false
},
{
"letter": "B. ",
"text": "Implement a checklist that engineers can follow when configuring compute instances",
"correct": false
},
{
"letter": "C. ",
"text": "Replace the compute instance type with a larger version to reduce the number of required deployments",
"correct": false
},
{
"letter": "D. ",
"text": "Implement a provisioning pipeline that deploys infrastructure configurations committed to your version control system following code reviews",
"correct": true
}
]
},
{
"text": "terraform init initializes a sample main.tf file in the current directory.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "Which two steps are required to provision new infrastructure in the Terraform workflow? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "Destroy",
"correct": false
},
{
"letter": "B. ",
"text": "Apply",
"correct": true
},
{
"letter": "C. ",
"text": "Import",
"correct": false
},
{
"letter": "D. ",
"text": "Init",
"correct": true
},
{
"letter": "E. ",
"text": "Validate",
"correct": false
}
]
},
{
"text": "Why would you use the terraform taint command?",
"responses": [
{
"letter": "A. ",
"text": "When you want to force Terraform to destroy a resource on the next apply",
"correct": false
},
{
"letter": "B. ",
"text": "When you want to force Terraform to destroy and recreate a resource on the next apply",
"correct": true
},
{
"letter": "C. ",
"text": "When you want Terraform to ignore a resource on the next apply",
"correct": false
},
{
"letter": "D. ",
"text": "When you want Terraform to destroy all the infrastructure in your workspace",
"correct": false
}
]
},
{
"text": "Terraform requires the Go runtime as a prerequisite for installation.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "When should you use the force-unlock command?",
"responses": [
{
"letter": "A. ",
"text": "You see a status message that you cannot acquire the lock",
"correct": false
},
{
"letter": "B. ",
"text": "You have a high priority change",
"correct": false
},
{
"letter": "C. ",
"text": "Automatic unlocking failed",
"correct": true
},
{
"letter": "D. ",
"text": "You apply failed due to a state lock",
"correct": false
}
]
},
{
"text": "Terraform can import modules from a number of sources `\" which of the following is not a valid source?",
"responses": [
{
"letter": "A. ",
"text": "FTP server",
"correct": true
},
{
"letter": "B. ",
"text": "GitHub repository",
"correct": false
},
{
"letter": "C. ",
"text": "Local path",
"correct": false
},
{
"letter": "D. ",
"text": "Terraform Module Registry",
"correct": false
}
]
},
{
"text": "Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?",
"responses": [
{
"letter": "A. ",
"text": "Secure variable storage",
"correct": true
},
{
"letter": "B. ",
"text": "Support for multiple cloud providers",
"correct": false
},
{
"letter": "C. ",
"text": "Dry runs with terraform plan",
"correct": false
},
{
"letter": "D. ",
"text": "Using the workspace as a data source",
"correct": false
}
]
},
{
"text": "terraform validate validates the syntax of Terraform files.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your\nTerraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.\nWhich command should you use to show all of the resources that will be deleted? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "Run terraform plan -destroy.",
"correct": true
},
{
"letter": "B. ",
"text": "This is not possible. You can only show resources that will be created.",
"correct": false
},
{
"letter": "C. ",
"text": "Run terraform state rm *.",
"correct": false
},
{
"letter": "D. ",
"text": "Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.",
"correct": true
}
]
}
,
{
"text": "Which of the following is the correct way to pass the value in the variable num_servers into a module with the input servers?",
"responses": [
{
"letter": "A. ",
"text": "servers = num_servers",
"correct": false
},
{
"letter": "B. ",
"text": "servers = variable.num_servers",
"correct": false
},
{
"letter": "C. ",
"text": "servers = var(num_servers)",
"correct": false
},
{
"letter": "D. ",
"text": "servers = var.num_servers",
"correct": true
}
]
},
{
"text": "A Terraform provisioner must be nested inside a resource configuration block.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "What does the default \"local\" Terraform backend store?",
"responses": [
{
"letter": "A. ",
"text": "tfplan files",
"correct": false
},
{
"letter": "B. ",
"text": "Terraform binary",
"correct": false
},
{
"letter": "C. ",
"text": "Provider plugins",
"correct": false
},
{
"letter": "D. ",
"text": "State file",
"correct": true
}
]
},
{
"text": "You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.\nHow can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?",
"responses": [
{
"letter": "A. ",
"text": "Run the terraform fmt command during the code linting phase of your CI/CD process",
"correct": true
},
{
"letter": "B. ",
"text": "Designate one person in each team to review and format everyone's code",
"correct": false
},
{
"letter": "C. ",
"text": "Manually apply two spaces indentation and align equal sign \"=\" characters in every Terraform file (*.tf)",
"correct": false
},
{
"letter": "D. ",
"text": "Write a shell script to transform Terraform files using tools such as AWK, Python, and sed",
"correct": false
}
]
}
,
{
"text": "What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?",
"responses": [
{
"letter": "A. ",
"text": "The ability to share modules with public Terraform users and members of Terraform Enterprise Organizations",
"correct": false
},
{
"letter": "B. ",
"text": "The ability to tag modules by version or release",
"correct": false
},
{
"letter": "C. ",
"text": "The ability to restrict modules to members of Terraform Cloud or Enterprise organizations",
"correct": true
},
{
"letter": "D. ",
"text": "The ability to share modules publicly with any user of Terraform",
"correct": false
}
]
},
{
"text": "Which task does terraform init not perform?",
"responses": [
{
"letter": "A. ",
"text": "Sources all providers present in the configuration and ensures they are downloaded and available locally",
"correct": false
},
{
"letter": "B. ",
"text": "Connects to the backend",
"correct": false
},
{
"letter": "C. ",
"text": "Sources any modules and copies the configuration locally",
"correct": false
},
{
"letter": "D. ",
"text": "Validates all required variables are present",
"correct": true
}
]
},
{
"text": "You have declared a variable called var.list which is a list of objects that all have an attribute id.\nWhich options will produce a list of the IDs? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "{ for o in var.list : o => o.id }",
"correct": false
},
{
"letter": "B. ",
"text": "var.list[*].id",
"correct": true
},
{
"letter": "C. ",
"text": "[ var.list[*].id ]",
"correct": false
},
{
"letter": "D. ",
"text": "[ for o in var.list : o.id ]",
"correct": true
}
]
},
{
"text": "Which argument(s) is (are) required when declaring a Terraform variable?",
"responses": [
{
"letter": "A. ",
"text": "type",
"correct": false
},
{
"letter": "B. ",
"text": "default",
"correct": false
},
{
"letter": "C. ",
"text": "description",
"correct": false
},
{
"letter": "D. ",
"text": "All of the above",
"correct": false
},
{
"letter": "E. ",
"text": "None of the above",
"correct": true
}
]
},
{
"text": "When using a module block to reference a module stored on the public Terraform Module Registry such as:\n\nHow do you specify version 1.0.0?",
"responses": [
{
"letter": "A. ",
"text": "Modules stored on the public Terraform Module Registry do not support versioning",
"correct": false
},
{
"letter": "B. ",
"text": "Append ?ref=v1.0.0 argument to the source path",
"correct": false
},
{
"letter": "C. ",
"text": "Add version = \"1.0.0\" attribute to module block",
"correct": true
},
{
"letter": "D. ",
"text": "Nothing ג€\" modules stored on the public Terraform Module Registry always default to version 1.0.0",
"correct": false
}
]
}
,
{
"text": "What features does the hosted service Terraform Cloud provide? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "Automated infrastructure deployment visualization",
"correct": false
},
{
"letter": "B. ",
"text": "Automatic backups",
"correct": false
},
{
"letter": "C. ",
"text": "Remote state storage",
"correct": true
},
{
"letter": "D. ",
"text": "A web-based user interface (UI)",
"correct": true
}
]
},
{
"text": "Where does the Terraform local backend store its state?",
"responses": [
{
"letter": "A. ",
"text": "In the /tmp directory",
"correct": false
},
{
"letter": "B. ",
"text": "In the terraform file",
"correct": false
},
{
"letter": "C. ",
"text": "In the terraform.tfstate file",
"correct": false
},
{
"letter": "D. ",
"text": "In the user's terraform.state file",
"correct": false
}
]
},
{
"text": "Which option can not be used to keep secrets out of Terraform configuration files?",
"responses": [
{
"letter": "A. ",
"text": "A Terraform provider",
"correct": false
},
{
"letter": "B. ",
"text": "Environment variables",
"correct": false
},
{
"letter": "C. ",
"text": "A -var flag",
"correct": false
},
{
"letter": "D. ",
"text": "secure string",
"correct": true
}
]
},
{
"text": "What is one disadvantage of using dynamic blocks in Terraform?",
"responses": [
{
"letter": "A. ",
"text": "They cannot be used to loop through a list of values",
"correct": false
},
{
"letter": "B. ",
"text": "Dynamic blocks can construct repeatable nested blocks",
"correct": false
},
{
"letter": "C. ",
"text": "They make configuration harder to read and understand",
"correct": true
},
{
"letter": "D. ",
"text": "Terraform will run more slowly",
"correct": false
}
]
},
{
"text": "Only the user that generated a plan may apply it.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "Examine the following Terraform configuration, which uses the data source for an AWS AMI.\nWhat value should you enter for the ami argument in the AWS instance resource?",
"responses": [
{
"letter": "A. ",
"text": "aws_ami.ubuntu",
"correct": false
},
{
"letter": "B. ",
"text": "data.aws_ami.ubuntu",
"correct": false
},
{
"letter": "C. ",
"text": "data.aws_ami.ubuntu.id",
"correct": true
},
{
"letter": "D. ",
"text": "aws_ami.ubuntu.id",
"correct": false
}
]
},
{
"text": "FILL BLANK -\nYou need to specify a dependency manually.\nWhat resource meta-parameter can you use to make sure Terraform respects the dependency?\nType your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.",
"responses": []
},
{
"text": "You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains\n15 virtual machines (VM). You develop a Terraform configuration containing one VM, perform terraform apply, and see that your VM was created successfully.\nWhat should you do to delete the newly-created VM with Terraform?",
"responses": [
{
"letter": "A. ",
"text": "The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.",
"correct": false
},
{
"letter": "B. ",
"text": "The Terraform state file only contains the one new VM. Execute terraform destroy.",
"correct": true
},
{
"letter": "C. ",
"text": "Delete the Terraform state file and execute Terraform apply.",
"correct": false
},
{
"letter": "D. ",
"text": "Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.",
"correct": false
}
]
},
{
"text": "What is the name assigned by Terraform to reference this resource?",
"responses": [
{
"letter": "A. ",
"text": "dev",
"correct": true
},
{
"letter": "B. ",
"text": "azurerm_resource_group",
"correct": false
},
{
"letter": "C. ",
"text": "azurerm",
"correct": false
},
{
"letter": "D. ",
"text": "test",
"correct": false
}
]
},
{
"text": "Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "Where in your Terraform configuration do you specify a state backend?",
"responses": [
{
"letter": "A. ",
"text": "The terraform block",
"correct": true
},
{
"letter": "B. ",
"text": "The resource block",
"correct": false
},
{
"letter": "C. ",
"text": "The provider block",
"correct": false
},
{
"letter": "D. ",
"text": "The datasource block",
"correct": false
}
]
},
{
"text": "In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "What command should you run to display all workspaces for the current configuration?",
"responses": [
{
"letter": "A. ",
"text": "terraform workspace",
"correct": false
},
{
"letter": "B. ",
"text": "terraform workspace show",
"correct": false
},
{
"letter": "C. ",
"text": "terraform workspace list",
"correct": true
},
{
"letter": "D. ",
"text": "terraform show workspace",
"correct": false
}
]
},
{
"text": "Terraform providers are always installed from the Internet.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "Which of these is the best practice to protect sensitive values in state files?",
"responses": [
{
"letter": "A. ",
"text": "Blockchain",
"correct": false
},
{
"letter": "B. ",
"text": "Secure Sockets Layer (SSL)",
"correct": false
},
{
"letter": "C. ",
"text": "Enhanced remote backends",
"correct": false
},
{
"letter": "D. ",
"text": "Signed Terraform providers",
"correct": false
}
]
}
,
{
"text": "When does terraform apply reflect changes in the cloud environment?",
"responses": [
{
"letter": "A. ",
"text": "Immediately",
"correct": false
},
{
"letter": "B. ",
"text": "However long it takes the resource provider to fulfill the request",
"correct": true
},
{
"letter": "C. ",
"text": "After updating the state file",
"correct": false
},
{
"letter": "D. ",
"text": "Based on the value provided to the -refresh command line argument",
"correct": false
},
{
"letter": "E. ",
"text": "None of the above",
"correct": false
}
]
},
{
"text": "How would you reference the \"name\" value of the second instance of this fictitious resource?",
"responses": [
{
"letter": "A. ",
"text": "element(aws_instance.web, 2)",
"correct": false
},
{
"letter": "B. ",
"text": "aws_instance.web[1].name",
"correct": true
},
{
"letter": "C. ",
"text": "aws_instance.web[1]",
"correct": false
},
{
"letter": "D. ",
"text": "aws_instance.web[2].name",
"correct": false
},
{
"letter": "E. ",
"text": "aws_instance.web.*.name",
"correct": false
}
]
},
{
"text": "A Terraform provider is not responsible for:",
"responses": [
{
"letter": "A. ",
"text": "Understanding API interactions with some service",
"correct": false
},
{
"letter": "B. ",
"text": "Provisioning infrastructure in multiple clouds",
"correct": true
},
{
"letter": "C. ",
"text": "Exposing resources and data sources based on an API",
"correct": false
},
{
"letter": "D. ",
"text": "Managing actions to take based on resource differences",
"correct": false
}
]
},
{
"text": "Terraform provisioners can be added to any resource block.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "What is terraform refresh intended to detect?",
"responses": [
{
"letter": "A. ",
"text": "Terraform configuration code changes",
"correct": false
},
{
"letter": "B. ",
"text": "Empty state files",
"correct": false
},
{
"letter": "C. ",
"text": "State file drift",
"correct": true
},
{
"letter": "D. ",
"text": "Corrupt state files",
"correct": false
}
]
}
,
{
"text": "FILL BLANK -\nWhich flag would you add to terraform plan to save the execution plan to a file?\nType your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.",
"responses": []
},
{
"text": "FILL BLANK -\nWhat is the name of the default file where Terraform stores the state?\nType your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.",
"responses": []
},
{
"text": "A Terraform local value can reference other Terraform local values.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "Which of the following is not a valid Terraform collection type?",
"responses": [
{
"letter": "A. ",
"text": "list",
"correct": false
},
{
"letter": "B. ",
"text": "map",
"correct": false
},
{
"letter": "C. ",
"text": "tree",
"correct": false
},
{
"letter": "D. ",
"text": "set",
"correct": false
}
]
},
{
"text": "When running the command terraform taint against a managed resource you want to force recreation upon, Terraform will immediately destroy and recreate the resource.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
}
,
{
"text": "All standard backend types support state storage, locking, and remote operations like plan, apply and destroy.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "How can terraform plan aid in the development process?",
"responses": [
{
"letter": "A. ",
"text": "Validates your expectations against the execution plan without permanently modifying state",
"correct": true
},
{
"letter": "B. ",
"text": "Initializes your working directory containing your Terraform configuration files",
"correct": false
},
{
"letter": "C. ",
"text": "Formats your Terraform configuration files",
"correct": false
},
{
"letter": "D. ",
"text": "Reconciles Terraform's state against deployed resources and permanently modifies state using the current status of deployed resources",
"correct": false
}
]
},
{
"text": "You would like to reuse the same Terraform configuration for your development and production environments with a different state file for each.\nWhich command would you use?",
"responses": [
{
"letter": "A. ",
"text": "terraform import",
"correct": false
},
{
"letter": "B. ",
"text": "terraform workspace",
"correct": true
},
{
"letter": "C. ",
"text": "terraform state",
"correct": false
},
{
"letter": "D. ",
"text": "terraform init",
"correct": false
}
]
},
{
"text": "What is the name assigned by Terraform to reference this resource?",
"responses": [
{
"letter": "A. ",
"text": "compute_instance",
"correct": false
},
{
"letter": "B. ",
"text": "main",
"correct": true
},
{
"letter": "C. ",
"text": "google",
"correct": false
},
{
"letter": "D. ",
"text": "teat",
"correct": false
}
]
},
{
"text": "You're building a CI/CD (continuous integration/ continuous delivery) pipeline and need to inject sensitive variables into your Terraform run.\nHow can you do this safely?",
"responses": [
{
"letter": "A. ",
"text": "Pass variables to Terraform with a ג€\"var flag",
"correct": true
},
{
"letter": "B. ",
"text": "Copy the sensitive variables into your Terraform code",
"correct": false
},
{
"letter": "C. ",
"text": "Store the sensitive variables in a secure_vars.tf file",
"correct": false
},
{
"letter": "D. ",
"text": "Store the sensitive variables as plain text in a source code repository",
"correct": false
}
]
}
,
{
"text": "Your security team scanned some Terraform workspaces and found secrets stored in a plaintext in state files.\nHow can you protect sensitive data stored in Terraform state files?",
"responses": [
{
"letter": "A. ",
"text": "Delete the state file every time you run Terraform",
"correct": false
},
{
"letter": "B. ",
"text": "Store the state in an encrypted backend",
"correct": false
},
{
"letter": "C. ",
"text": "Edit your state file to scrub out the sensitive data",
"correct": false
},
{
"letter": "D. ",
"text": "Always store your secrets in a secrets.tfvars file.",
"correct": false
}
]
},
{
"text": "In contrast to Terraform Open Source, when working with Terraform Enterprise and Cloud Workspaces, conceptually you could think about them as completely separate working directories.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": true
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (*.tf files). You need to enable debug messages to find this out.\nWhich of the following would achieve this?",
"responses": [
{
"letter": "A. ",
"text": "Set the environment variable TF_LOG=TRACE",
"correct": true
},
{
"letter": "B. ",
"text": "Set verbose logging for each provider in your Terraform configuration",
"correct": false
},
{
"letter": "C. ",
"text": "Set the environment variable TF_VAR_log=TRACE",
"correct": false
},
{
"letter": "D. ",
"text": "Set the environment variable TF_LOG_PATH",
"correct": false
}
]
},
{
"text": "How is terraform import run?",
"responses": [
{
"letter": "A. ",
"text": "As a part of terraform init",
"correct": false
},
{
"letter": "B. ",
"text": "As a part of terraform plan",
"correct": false
},
{
"letter": "C. ",
"text": "As a part of terraform refresh",
"correct": false
},
{
"letter": "D. ",
"text": "By an explicit call",
"correct": true
},
{
"letter": "E. ",
"text": "All of the above",
"correct": false
}
]
},
{
"text": "You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.\nWhat will happen if you delete the VM using the cloud provider console, and run terraform apply again without changing any Terraform code?",
"responses": [
{
"letter": "A. ",
"text": "Terraform will remove the VM from state file",
"correct": false
},
{
"letter": "B. ",
"text": "Terraform will report an error",
"correct": false
},
{
"letter": "C. ",
"text": "Terraform will not make any changes",
"correct": false
},
{
"letter": "D. ",
"text": "Terraform will recreate the VM",
"correct": true
}
]
}
,
{
"text": "Which of these options is the most secure place to store secrets foe connecting to a Terraform remote backend?",
"responses": [
{
"letter": "A. ",
"text": "Defined in Environment variables",
"correct": true
},
{
"letter": "B. ",
"text": "Inside the backend block within the Terraform configuration",
"correct": false
},
{
"letter": "C. ",
"text": "Defined in a connection configuration outside of Terraform",
"correct": true
},
{
"letter": "D. ",
"text": "None of above",
"correct": false
}
]
},
{
"text": "Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to begin storing the state file in a central location.\nWhich of the following backends would not work?",
"responses": [
{
"letter": "A. ",
"text": "Amazon S3",
"correct": false
},
{
"letter": "B. ",
"text": "Artifactory",
"correct": false
},
{
"letter": "C. ",
"text": "Git",
"correct": true
},
{
"letter": "D. ",
"text": "Terraform Cloud",
"correct": false
}
]
},
{
"text": "Which backend does the Terraform CLI use by default?",
"responses": [
{
"letter": "A. ",
"text": "Terraform Cloud",
"correct": false
},
{
"letter": "B. ",
"text": "Consul",
"correct": false
},
{
"letter": "C. ",
"text": "Remote",
"correct": false
},
{
"letter": "D. ",
"text": "Local",
"correct": false
}
]
},
{
"text": "When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?",
"responses": [
{
"letter": "A. ",
"text": "On disk in the /tmp directory",
"correct": false
},
{
"letter": "B. ",
"text": "In memory",
"correct": false
},
{
"letter": "C. ",
"text": "On disk in the .terraform sub-directory",
"correct": true
},
{
"letter": "D. ",
"text": "They are not cached",
"correct": false
}
]
},
{
"text": "You write a new Terraform configuration and immediately run terraform apply in the CLI using the local backend.\nWhy will the apply fail?",
"responses": [
{
"letter": "A. ",
"text": "Terraform needs you to format your code according to best practices first",
"correct": false
},
{
"letter": "B. ",
"text": "Terraform needs to install the necessary plugins first",
"correct": true
},
{
"letter": "C. ",
"text": "The Terraform CLI needs you to log into Terraform cloud first",
"correct": false
},
{
"letter": "D. ",
"text": "Terraform requires you to manually run terraform plan first",
"correct": false
}
]
}
,
{
"text": "What features stops multiple admins from changing the Terraform state at the same time?",
"responses": [
{
"letter": "A. ",
"text": "Version control",
"correct": false
},
{
"letter": "B. ",
"text": "Backend types",
"correct": false
},
{
"letter": "C. ",
"text": "Provider constraints",
"correct": false
},
{
"letter": "D. ",
"text": "State locking",
"correct": true
}
]
},
{
"text": "A fellow developer on your team is asking for some help in refactoring their Terraform code. As part of their application's architecture, they are going to tear down an existing deployment managed by Terraform and deploy new. However, there is a server resource named aws_instance.ubuntu[1] they would like to keep to perform some additional analysis.\nWhat command should be used to tell Terraform to no longer manage the resource?",
"responses": [
{
"letter": "A. ",
"text": "terraform apply rm aws_instance.ubuntu[1]",
"correct": false
},
{
"letter": "B. ",
"text": "terraform state rm aws_instance.ubuntu[1]",
"correct": true
},
{
"letter": "C. ",
"text": "terraform plan rm aws_instance.ubuntu[1]",
"correct": false
},
{
"letter": "D. ",
"text": "terraform delete aws_instance.ubuntu[1]",
"correct": false
}
]
},
{
"text": "Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "A terraform apply can not _________ infrastructure.",
"responses": [
{
"letter": "A. ",
"text": "change",
"correct": false
},
{
"letter": "B. ",
"text": "destroy",
"correct": false
},
{
"letter": "C. ",
"text": "provision",
"correct": false
},
{
"letter": "D. ",
"text": "import",
"correct": false
}
]
},
{
"text": "You need to constrain the GitHub provider to version 2.1 or greater.\nWhich of the following should you put into the Terraform 0.12 configuration's provider block?",
"responses": [
{
"letter": "A. ",
"text": "version >= 2.1",
"correct": true
},
{
"letter": "B. ",
"text": "version ~> 2.1",
"correct": false
},
{
"letter": "C. ",
"text": "version = ג€<= 2.1ג€",
"correct": false
},
{
"letter": "D. ",
"text": "version = ג€>= 2.1ג€",
"correct": true
}
]
}
,
{
"text": "You just scaled your VM infrastructure and realized you set the count variable to the wrong value. You correct the value and save your change.\nWhat do you do next to make your infrastructure match your configuration?",
"responses": [
{
"letter": "A. ",
"text": "Run an apply and confirm the planned changes",
"correct": true
},
{
"letter": "B. ",
"text": "Inspect your Terraform state because you want to change it",
"correct": false
},
{
"letter": "C. ",
"text": "Reinitialize because your configuration has changed",
"correct": false
},
{
"letter": "D. ",
"text": "Inspect all Terraform outputs to make sure they are correct",
"correct": false
}
]
},
{
"text": "Terraform provisioners that require authentication can use the ______ block.",
"responses": [
{
"letter": "A. ",
"text": "connection",
"correct": true
},
{
"letter": "B. ",
"text": "credentials",
"correct": false
},
{
"letter": "C. ",
"text": "secrets",
"correct": false
},
{
"letter": "D. ",
"text": "ssh",
"correct": false
}
]
},
{
"text": "Terraform validate reports syntax check errors from which of the following scenarios?",
"responses": [
{
"letter": "A. ",
"text": "Code contains tabs indentation instead of spaces",
"correct": false
},
{
"letter": "B. ",
"text": "There is missing value for a variable",
"correct": true
},
{
"letter": "C. ",
"text": "The state files does not match the current infrastructure",
"correct": false
},
{
"letter": "D. ",
"text": "None of the above",
"correct": true
}
]
},
{
"text": "Which of the following is allowed as a Terraform variable name?",
"responses": [
{
"letter": "A. ",
"text": "count",
"correct": false
},
{
"letter": "B. ",
"text": "name",
"correct": true
},
{
"letter": "C. ",
"text": "source",
"correct": false
},
{
"letter": "D. ",
"text": "version",
"correct": false
}
]
},
{
"text": "What type of block is used to construct a collection of nested configuration blocks?",
"responses": [
{
"letter": "A. ",
"text": "for_each",
"correct": false
},
{
"letter": "B. ",
"text": "repeated",
"correct": false
},
{
"letter": "C. ",
"text": "nesting",
"correct": false
},
{
"letter": "D. ",
"text": "dynamic",
"correct": true
}
]
}
,
{
"text": "Module variable assignments are inherited from the parent module and do not need to be explicitly set.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "If writing Terraform code that adheres to the Terraform style conventions, how would you properly indent each nesting level compared to the one above it?",
"responses": [
{
"letter": "A. ",
"text": "With four spaces",
"correct": false
},
{
"letter": "B. ",
"text": "With a tab",
"correct": false
},
{
"letter": "C. ",
"text": "With three spaces",
"correct": false
},
{
"letter": "D. ",
"text": "With two spaces",
"correct": true
}
]
},
{
"text": "Which of the following is not an action performed by terraform init?",
"responses": [
{
"letter": "A. ",
"text": "Create a sample main.tf file",
"correct": true
},
{
"letter": "B. ",
"text": "Initialize a configured backend",
"correct": false
},
{
"letter": "C. ",
"text": "Retrieve the source code for all referenced modules",
"correct": false
},
{
"letter": "D. ",
"text": "Load required provider plugins",
"correct": false
}
]
},
{
"text": "HashiCorp Configuration Language (HCL) supports user-defined functions.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": false
}
]
},
{
"text": "How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?",
"responses": [
{
"letter": "A. ",
"text": "Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces",
"correct": false
},
{
"letter": "B. ",
"text": "Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to",
"correct": true
},
{
"letter": "C. ",
"text": "Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces",
"correct": false
},
{
"letter": "D. ",
"text": "Only Terraform Cloud organization owners can approve plans in VCS connected workspaces",
"correct": false
}
]
}
,
{
"text": "Terraform and Terraform providers must use the same major version number in a single configuration.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "Which statement describes a goal of infrastructure as code?",
"responses": [
{
"letter": "A. ",
"text": "An abstraction from vendor specific APIs",
"correct": false
},
{
"letter": "B. ",
"text": "Write once, run anywhere",
"correct": false
},
{
"letter": "C. ",
"text": "A pipeline process to test and deliver software",
"correct": false
},
{
"letter": "D. ",
"text": "The programmatic configuration of resources",
"correct": true
}
]
},
{
"text": "When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)",
"responses": [
{
"letter": "A. ",
"text": "When a change is made to the resources via the Azure Cloud Console, the changes are recorded in a new state file",
"correct": false
},
{
"letter": "B. ",
"text": "When a change is made to the resources via the Azure Cloud Console, Terraform will update the state file to reflect them during the next plan or apply",
"correct": true
},
{
"letter": "C. ",
"text": "When a change is made to the resources via the Azure Cloud Console, the current state file will not be updated",
"correct": true
},
{
"letter": "D. ",
"text": "When a change is made to the resources via the Azure Cloud Console, the changes are recorded in the current state file",
"correct": false
}
]
},
{
"text": "You need to deploy resources into two different cloud regions in the same Terraform configuration. To do that, you declare multiple provider configurations as follows:\n\nWhat meta-argument do you need to configure in a resource block to deploy the resource to the `us-west-2` AWS region?",
"responses": [
{
"letter": "A. ",
"text": "alias = west",
"correct": false
},
{
"letter": "B. ",
"text": "provider = west",
"correct": false
},
{
"letter": "C. ",
"text": "provider = aws.west",
"correct": true
},
{
"letter": "D. ",
"text": "alias = aws.west",
"correct": false
}
]
},
{
"text": "You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?",
"responses": [
{
"letter": "A. ",
"text": "Add node_count = var.node_count",
"correct": false
},
{
"letter": "B. ",
"text": "Declare the variable in a terraform.tfvars file",
"correct": true
},
{
"letter": "C. ",
"text": "Declare a node_count input variable for child module",
"correct": true
},
{
"letter": "D. ",
"text": "Nothing, child modules inherit variables of parent module",
"correct": false
}
]
}
,
{
"text": "If a module declares a variable with a default, that variable must also be defined within the module.",
"responses": [
{
"letter": "A. ",
"text": "True",
"correct": false
},
{
"letter": "B. ",
"text": "False",
"correct": true
}
]
},
{
"text": "Which option cannot be used to keep secrets out of Terraform configuration files?",
"responses": [
{
"letter": "A. ",
"text": "Environment Variables",
"correct": false
},
{
"letter": "B. ",
"text": "Mark the variable as sensitive",
"correct": true
},
{
"letter": "C. ",
"text": "A Terraform provider",
"correct": true
},
{
"letter": "D. ",
"text": "A -var flag",
"correct": false
}
]
},
{
"text": "Which of the following arguments are required when declaring a Terraform output?",
"responses": [
{
"letter": "A. ",
"text": "sensitive",
"correct": false
},
{
"letter": "B. ",
"text": "description",
"correct": false
},
{
"letter": "C. ",
"text": "default",
"correct": false
},
{
"letter": "D. ",
"text": "value",
"correct": true
}
]
},
{
"text": "Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Enterprise automatically and proactively enforce this security control?",
"responses": [
{
"letter": "A. ",
"text": "With a Sentinel policy, which runs before every apply",
"correct": true
},
{
"letter": "B. ",
"text": "By adding variables to each TFE workspace to ensure these settings are always enabled",
"correct": false
},
{
"letter": "C. ",
"text": "With an S3 module with proper settings for buckets",
"correct": false
},
{
"letter": "D. ",
"text": "Auditing cloud storage buckets with a vulnerability scanning tool",
"correct": false
}
]
},
{
"text": "Most Terraform providers interact with ____________.",
"responses": [
{
"letter": "A. ",
"text": "API",
"correct": false
},
{
"letter": "B. ",
"text": "VCS Systems",
"correct": false
},
{
"letter": "C. ",
"text": "Shell scripts",
"correct": false
},
{
"letter": "D. ",
"text": "None of the above",
"correct": false
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment