exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 59 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 59
Topic #: 1
[All Terraform Associate Questions]

Terraform provisioners can be added to any resource block.

  • A. True
  • B. False
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
GopinathM
Highly Voted 2 years ago
A is correct https://www.terraform.io/language/resources/provisioners/syntax resource "aws_instance" "web" { # ... provisioner "local-exec" { command = "echo The server's IP address is ${self.private_ip}" } }
upvoted 16 times
...
agmesas
Highly Voted 1 year, 7 months ago
Selected Answer: A
the key of this question is "could you use a local-exec provisioner in any type of resource?", yes, because the execution of this provisioner is on my local so we couldnuse local-exec in any resource type because it is independent of the type of resource. Answer is A "true"
upvoted 10 times
...
suri_surendra
Most Recent 2 months, 1 week ago
Selected Answer: B
The correct answer is: B. False Explanation: Terraform provisioners are not automatically supported in all resource blocks. They are designed to be used with specific types of resources, primarily those that involve remote execution or configuration (such as virtual machines or instances). However, not every resource type is compatible with provisioners.
upvoted 1 times
...
samimshaikh
8 months, 2 weeks ago
Selected Answer: A
A. True Terraform provisioners can be added to any resource block. Provisioners are used to execute scripts or commands on a local or remote machine as part of resource creation or destruction. They are defined within a resource block and allow you to perform actions such as initializing, configuring, or setting up resources after they have been created.
upvoted 2 times
...
Pradh
11 months, 2 weeks ago
answer should be "B" Can you add a provisioner to below resource block ? ============================== resource "azurerm_network_interface" "Nic-1" ==============================
upvoted 3 times
ilmi70
6 months, 3 weeks ago
resource "azurerm_network_interface" "Nic-1" { # ... provisioner "local-exec" { command = "echo 'Network interface created'" } }
upvoted 4 times
...
...
debabrata6983
1 year ago
Selected Answer: A
Please stop confusing people. Basics of Provisioner block : always bind with resource block
upvoted 7 times
...
Bere
1 year, 1 month ago
Selected Answer: A
Since the local-exec provisioner executes on the machine running Terraform and not on the resource itself, it can indeed be added to any resource block. The actions taken by the local-exec provisioner are not dependent on the type of resource, so it's possible to use this provisioner with any resource in Terraform.
upvoted 4 times
...
modarov
1 year, 1 month ago
The answer is False. Terraform provisioners can only be added to resource blocks that support them
upvoted 2 times
...
LunarPhobia
1 year, 1 month ago
The new exam doesn't ask about provisioners anymore
upvoted 3 times
...
Ha_Baruh_Architect13
1 year, 1 month ago
The correct answer is B. False. Terraform provisioners are not added to resource blocks directly. Instead, provisioners are added as separate blocks within a resource block. Provisioners are used to execute scripts or commands on a resource after it has been created or updated. They are defined outside of the resource block and are associated with the resource using the "provisioner" keyword followed by the specific provisioner type CHATGPT
upvoted 1 times
...
Jlee7
1 year, 2 months ago
The answer is False. Terraform provisioners can only be added to resource blocks that support them. For example, the AWS provider supports the remote-exec provisioner, but the Azure provider does not.
upvoted 1 times
joyboy23
1 year, 2 months ago
But what about the local-exec ?
upvoted 1 times
...
...
Ni33
1 year, 4 months ago
Selected Answer: A
AAAAAAAA
upvoted 2 times
...
Bluemoon22
1 year, 4 months ago
The answer is A
upvoted 2 times
...
sylvergorilla
1 year, 4 months ago
Selected Answer: A
Yes, Terraform provisioners can be added to any resource block. Provisioners are used to execute scripts or commands on a resource after it has been created or updated.
upvoted 3 times
...
Power123
1 year, 5 months ago
A is correct
upvoted 1 times
...
Nunyabiznes
1 year, 5 months ago
Selected Answer: A
Provisioners can be added to any resource block in Terraform configuration, but it is not recommended to use them for configuration management as it goes against the declarative approach of Terraform. Provisioners should only be used as a last resort when no other Terraform resource types are available to handle a specific task.
upvoted 3 times
...
Tanacet
1 year, 7 months ago
Selected Answer: A
Provisioner is an arbitrary command executed by the terraform when a resource is created/destroyed. It is not related to a resource itself. The creation/destruction of a resource is just a trigger.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago