nerdexam
HashiCorp

TA-002-P · Question #87

Terraform provisioners that require authentication can use the ______ block.

The correct answer is A. connection. Terraform provisioners that interact with remote resources and require authentication can utilize the connection block to define how to establish a connection, including specifying authentication details like SSH keys or WinRM credentials.

Read, generate, and modify configuration

Question

Terraform provisioners that require authentication can use the ______ block.

Options

  • Aconnection
  • Bcredentials
  • Csecrets
  • Dssh

How the community answered

(52 responses)
  • A
    94% (49)
  • B
    2% (1)
  • D
    4% (2)

Why each option

Terraform provisioners that interact with remote resources and require authentication can utilize the `connection` block to define how to establish a connection, including specifying authentication details like SSH keys or WinRM credentials.

AconnectionCorrect

The `connection` block within a Terraform resource or provisioner is used to define the parameters for connecting to the remote resource where the provisioner will execute. This includes specifying connection type (e.g., SSH, WinRM) and authentication details like username, password, or private key.

Bcredentials

`credentials` is not a standard Terraform block used for provisioner authentication; authentication details are part of the `connection` block.

Csecrets

`secrets` is not a standard Terraform block for provisioner authentication; while secrets are used, their configuration for connection is via the `connection` block.

Dssh

`ssh` is a type of connection protocol, not a generic block for all authentication; the `connection` block encapsulates various types, including SSH.

Concept tested: Terraform provisioner connection block for authentication

Source: https://developer.hashicorp.com/terraform/language/resources/provisioners/syntax#connection-block

Topics

#Terraform provisioners#Connection block#Authentication#Remote execution

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice