terraform-provider-vra7 icon indicating copy to clipboard operation
terraform-provider-vra7 copied to clipboard

Error: Incorrect attribute value type: Inappropriate value for attribute "host": string required.

Open hobovirtual opened this issue 4 years ago • 2 comments

vRA 7.x version vRealize Automation 7.6

Terraform version v0.12.24

terraform-provider-vra7 plugin version terraform-provider-vra7 plugin version 1.0.1

Describe the bug Trying to use the remote_exec provisioner to execute commands post installation. When we use the examples provided in the documentation we get an error.

To Reproduce Steps to reproduce the behavior:

  1. define the following in any maint.tf
  connection {
    host     = self.resource_configuration[*].ip_address
    user     = var.upn_username
    password = var.domain_password
    type     = "ssh"
  }
 
  provisioner "remote-exec" {
    inline = [
      "echo hello"
    ]
  }
  1. Terraform command terraform apply

  2. Error Error: Incorrect attribute value type: Inappropriate value for attribute "host": string required.

Expected behavior remote command to be executed on the target

Desktop (please complete the following information):

  • OS: Windows 2016 and CentOS 7

Extra Information If i remove the block above and just output the information the information is displayed as expected but in an array and not a single string

output "vm_name" {
  value = ["${vra7_deployment.deployment[*].resource_configuration[*].name}"]
}
 
output "vm_ip" {
  value = ["${vra7_deployment.deployment[*].resource_configuration[*].ip_address}"]
}

The issue appears to be related to the self object and the way the data is return from the data map from the provider!?

hobovirtual avatar Apr 27 '20 14:04 hobovirtual