Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 87


Terraform provisioners that require authentication can use the ______ block.

Show Answer
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

12 comments
Sign in to comment
BaburTurkOption: A
Feb 25, 2024

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
Sep 14, 2023

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.

EltoothOption: A
Dec 28, 2022

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

aadi1121Option: A
Jan 23, 2023

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

NashP
Aug 2, 2024

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

Zam88
Dec 19, 2022

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

Power123
Sep 30, 2023

A is correct. Connection block

BurakkoOption: A
Mar 1, 2023

Must be the connection block.

asudhinOption: A
Apr 3, 2023

It is A

adoubanOption: A
Jun 12, 2023

A is correct

resnefOption: A
Jul 10, 2023

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

TlakminiOption: A
Feb 10, 2024

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