Terraform provisioners that require authentication can use the ______ block.
Terraform provisioners that require authentication can use the ______ block.
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.
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" }
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.
https://www.terraform.io/language/resources/provisioners/connection
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
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
A is correct. Connection block
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
https://developer.hashicorp.com/terraform/cli/config/config-file
connection block: https://developer.hashicorp.com/terraform/language/resources/provisioners/connection#connection-block
A is correct
It is A
Must be the connection block.