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

Terraform provisioners that require authentication can use the ______ block.

    Correct Answer: A

    Terraform provisioners that require authentication can use the connection block. The connection block is designed to configure the authentication settings for a Terraform provisioner, such as the username, password, and SSH key for connecting to remote resources. This block is essential for most provisioners which need to access remote resources via SSH or WinRM, ensuring that appropriate authentication details are provided.

Discussion
BaburTurkOption: A

The answer is A. connection. The connection block is used to configure the authentication settings for a Terraform provisioner. This includes the username, password, and SSH key that will be used to connect to the remote resource. The credentials and secrets blocks are used to store sensitive information, such as passwords and SSH keys. These blocks are not directly used by provisioners, but they can be referenced by the connection block. The ssh block is used to configure the SSH client that Terraform will use to connect to the remote resource. This block is not typically used by provisioners, as the connection block can be used to configure the SSH client for all provisioners. Here is an example of a connection block for a provisioner that requires SSH authentication: connection { host = "example.com" user = "root" password = "my-password" }

tgaosOption: A

https://developer.hashicorp.com/terraform/language/resources/provisioners/connection Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect.

aadi1121Option: A

https://www.terraform.io/language/resources/provisioners/connection

EltoothOption: A

A is correct answer : connection. "Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect." "Connection blocks don't take a block label and can be nested within either a resource or a provisioner." https://www.terraform.io/language/resources/provisioners/connection

NashPOption: A

resource "aws_instance" "example" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" connection { type = "ssh" user = "ec2-user" private_key = file("~/.ssh/private_key.pem") } provisioner "remote-exec" { inline = [ "echo 'Hello, World!' > hello.txt", ] } } A connection

Power123Option: A

A is correct. Connection block

Zam88Option: A

Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect. A

TlakminiOption: A

https://developer.hashicorp.com/terraform/cli/config/config-file

resnefOption: A

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

adoubanOption: A

A is correct

asudhinOption: A

It is A

BurakkoOption: A

Must be the connection block.