vmware / terraform-provider-vra

Terraform Provider for VMware Aria Automation
https://registry.terraform.io/providers/vmware/vra/
Mozilla Public License 2.0
101 stars 89 forks source link

`d/vra_deployments`: Error: error setting deployment inputs #493

Open kkawatra09 opened 1 year ago

kkawatra09 commented 1 year ago

Error: error setting deployment inputs - error: &errors.errorString{s:"inputs.disks: '' expected type 'string', got unconvertible type '[]interface {}', value: '[]'"}

an2ane commented 1 year ago

What's your inputs, vRA provider & TF version? How to reproduce?

ajoga commented 1 year ago

Same issue here whether I specify id or name.

data "vra_deployment" "this" {
  id = "01cc2b84-357a-4fd9-98d9-0f7a94922da1"
}
╷
│ Error: error setting deployment inputs - error: &errors.errorString{s:"inputs.Local_Mapping1: '' expected type 'string', got unconvertible type 'bool', value: 'false'"}
│
│   with data.vra_deployment.this,
│   on main.tf line 22, in data "vra_deployment" "this":
│   22: data "vra_deployment" "this" {
│
╵
$ terraform -version
Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/vmware/vra v0.7.2

I only have another data source for a vra_security_group that works well.

I tried provider version v0.4.1 and 0.3.9, same error

an2ane commented 1 year ago

The provider takes string, number, bool as inputs. For example, if you use "Properties", you have to "jsonencode" it to be able to send it to vRA.

What is the type of "inputs.Local_Mapping1"?

ajoga commented 1 year ago

What is the type of "inputs.Local_Mapping1"?

I didn't define anything named as such so I have no idea. The provider is defined this way:

provider "vra" {
  url = var.vra_endpoint
}

And I run terraform with

export VRA_ACCESS_TOKEN="<your access token>"
terraform apply
an2ane commented 1 year ago

No issue at all using the last version of the vra provider, nor a custom made for a future push.

terraform -version
Terraform v1.2.6
on windows_amd64
+ provider local/vmware/vra v0.7.3

Working on vRA Cloud 8.12.1

data "vra_deployment" "this" {
  id = "myid"
}

output "test" {
  value = data.vra_deployment.this
}

Changes to Outputs:
   test = {
       blueprint_id         = "wwwww"
       blueprint_version    = "1.0.9"
       catalog_item_id      = "yyyyy"
       catalog_item_version = "1.0.9"
       created_at           = "2023-05-23T13:44:31.900Z"
       created_by           = "myname@company.com"
       description          = ""
       expand_last_request  = false
       expand_project       = false
       expand_resources     = false
       expense              = []
       id                   = "myid"
       ...
}

You should check the Terraform logs

$env:TF_LOG = "TRACE"
$env:TF_LOG_PATH="./logs/terraform_TRACE.log"