Recall & Review
beginner
What is the purpose of the
file provisioner in Terraform?The
file provisioner copies files or directories from the machine running Terraform to the target resource, such as a virtual machine, during provisioning.Click to reveal answer
beginner
Which argument specifies the source file or directory in a Terraform
file provisioner?The
source argument specifies the path to the file or directory on the local machine that you want to copy to the target resource.Click to reveal answer
beginner
How do you specify the destination path on the target machine in a Terraform
file provisioner?Use the
destination argument to set the path on the target machine where the file or directory will be copied.Click to reveal answer
intermediate
When does the
file provisioner run during Terraform execution?The
file provisioner runs after the resource is created but before Terraform marks the resource as fully created.Click to reveal answer
intermediate
Why should you avoid using provisioners like
file when possible in Terraform?Provisioners can cause unpredictable behavior and make infrastructure less declarative. It's better to use native resource configurations or configuration management tools for setup.
Click to reveal answer
What does the
file provisioner do in Terraform?✗ Incorrect
The file provisioner copies files or directories from the local machine to the target resource during provisioning.
Which argument specifies the destination path in a
file provisioner?✗ Incorrect
The destination argument sets where the file will be copied on the target machine.
When does the
file provisioner run during Terraform apply?✗ Incorrect
The file provisioner runs after the resource is created but before Terraform finishes the apply.
Which of these is a best practice regarding provisioners like
file?✗ Incorrect
Provisioners can cause unpredictable results; it's better to avoid them when possible.
What must be true about the source path in a
file provisioner?✗ Incorrect
The source path must be a local file or directory accessible to Terraform.
Explain how the
file provisioner works in Terraform and when it is used.Think about copying files to a new virtual machine after it is created.
You got /3 concepts.
Describe the key arguments needed to configure a
file provisioner in Terraform.What do you need to tell Terraform where to copy from and to?
You got /3 concepts.