azurerm_virtual_machine (remote-exec): (output suppressed due to sensitive value in config) Terraform output

Viewed 458

I'm looking for a way to see what is going on during creation of a virtual machine since I use complex cluster configuration and to test if its working I need to be able to see the output and in some cases I'm not due to sensitive. This is related to running remote-exec option

module.MongoInstall.azurerm_virtual_machine.MongoVirtualMachine[2] (remote-exec): (output suppressed due to sensitive value in config)

could you please help me

  provisioner "remote-exec" {
inline = [
  "chmod +x /tmp/mongo-activate.sh",
  "cd /tmp",
  "sudo ./mongo-activate.sh ${var.username} ${var.vmpassword} ${var.mongopassword} ${local.isCluster} ${join("," ,azurerm_public_ip.MongoPublicIpAddress.*.fqdn)} ${var.hasArbiter}",
  "rm mongo-activate.sh",
]

connection {
  type     = "ssh"
  host     = "${element(azurerm_public_ip.MongoPublicIpAddress.*.ip_address, 0)}"
  user     = "${var.username}"
  password = var.vmpassword
  timeout  = "15m"
}

}

Example of variables:

     variable "vmpassword" {
    default = "testtesttest"   //psw:mongo VM
}
1 Answers

Thank You Adnriy for your suggestion.

Yes we can not see the sesitive value in console like password and Key after terraform apply .Terraform will suppress logging from the provisioner.If provisioner configuration or connection info includes sensitive values, we need to unmark them before calling the provisioner. Failing to do so causes serialization to error.

Like you can see in below image enter image description here

Related