Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 59

Terraform provisioners can be added to any resource block.

    Correct Answer: B

    A

    Reference:

    https://www.terraform.io/docs/language/resources/provisioners/syntax.html

Discussion
GopinathMOption: A

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}" } }

agmesasOption: 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"

debabrata6983Option: A

Please stop confusing people. Basics of Provisioner block : always bind with resource block

BereOption: 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.

PradhOption: B

answer should be "B" Can you add a provisioner to below resource block ? ============================== resource "azurerm_network_interface" "Nic-1" ==============================

ilmi70

resource "azurerm_network_interface" "Nic-1" { # ... provisioner "local-exec" { command = "echo 'Network interface created'" } }

LunarPhobia

The new exam doesn't ask about provisioners anymore

sylvergorillaOption: 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.

NunyabiznesOption: 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.

TanacetOption: 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.

samimshaikhOption: 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.

modarovOption: B

The answer is False. Terraform provisioners can only be added to resource blocks that support them

Ni33Option: A

AAAAAAAA

Bluemoon22Option: A

The answer is A

Ha_Baruh_Architect13Option: B

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

Jlee7Option: B

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.

joyboy23

But what about the local-exec ?

Power123Option: A

A is correct

FarziWaliMarziOption: A

Option A is common sense