Hashicorp Terraform Associate Cert Comprehensive Questions with Correct Answers Accuracy
Hashicorp Terraform Associate Cert Comprehensive Questions with Correct Answers Accuracy Are provisioners runs only when the resource is created or destroyed? - Answer Provisioners are only run when a resource is created or destroyed. Provisioners that are run while destroying are Destroy provisioners. They are not a replacement for configuration management and changing the software of an alreadyrunning server, and are instead just meant as a way to bootstrap a server. By default, provisioners that fail will also cause the Terraform apply itself to fail. (True/False) - Answer True By default, provisioners that fail will also cause the Terraform apply itself to fail. How do you change this? - Answer The on_failure setting can be used to change this. The allowed values are: continue: Ignore the error and continue with creation or destruction. fail: Raise an error and stop applying (the default behavior). If this is a creation provisioner, taint the resource. // Example resource "aws_instance" "web" { # ... provisioner "local-exec" { command = "echo The server's IP address is ${te_ip}" on_failure = "continue" } } Expressions in provisioner blocks cannot refer to their parent resource by name. (True/False) - Answer True
Document information
- Uploaded on
- July 31, 2024
- Number of pages
- 13
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers