0
0
Terraformcloud~5 mins

File provisioner in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ARuns shell commands on the target resource
BDeletes files on the target resource
CCreates new resources in the cloud
DCopies files from local machine to the target resource
Which argument specifies the destination path in a file provisioner?
Adestination
Bpath
Ctarget
Dsource
When does the file provisioner run during Terraform apply?
ABefore resource creation
BAfter resource creation
CDuring resource destruction
DBefore Terraform plan
Which of these is a best practice regarding provisioners like file?
AUse them to create cloud resources
BUse them for all configuration tasks
CAvoid them when possible
DUse them to delete resources
What must be true about the source path in a file provisioner?
AIt must exist on the local machine running Terraform
BIt must be a remote URL
CIt must be inside the target resource
DIt must be a cloud storage path
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.