Desk 2 Flashcards
What is the command format to save a Terraform plan output to a file called lewis?
terraform plan -out=lewis
What are some of the features/functions of Terraform state?
Increased performance
Mapping configuration to real-world resources
Determining the correct order to destroy resources
Which Terraform feature would you use to iterate over a set of items, avoiding having to write code for each item explicitly?
A dynamic block
Terraform’s workspaces are the same in OSS and Cloud, true or false?
False.
A workspace in Cloud is like a whole new working directory, whereas in OSS it’s simply a different state file.
What does the ~> version constraint mean when pinning versions?
Only the rightmost version component is allowed to increase.
Which configuration line would you use to identify the version of a provider required?
required_providers
Which files should you set Git to ignore when commiting your code to a repo?
terraform.tfvars
terraform.tfstate
.terraform [Lewis added]
Which Terraform command can be used to inspect the current state file?
terraform show
What does the local-exec provisioner do?
Allows you to execute commands on the machine running Terraform, and to invoke a local executable.
How would you choose a specific module tag (in Git) as a source?
In a module block, add the source argument with “git::”, the Git URL and the tag, in the form “?ref=v1.0.4”, where v1.0.4 is the version tagged version.
Example:
module “vpc” {
source = “git::https://example.com/vpc.git?ref=v1.2.0”
}