vmware-archive / legacy-terraform-provider-vra7

Terraform provider for vRealize Automation 7
Mozilla Public License 2.0
60 stars 35 forks source link

XaaS Blueprint with array/string input fails with expected type 'string', got unconvertible type '[]interface {}'` #159

Open javansickle opened 5 years ago

javansickle commented 5 years ago

vRA 7.x version 7.4

Terraform version Terraform v0.11.11

terraform-provider-vra7 plugin version provider.vra7 v0.2.0

Describe the bug Have a simple XaaS Blueprint using a simple form. The underlying vRO workflow has an input field type of array/string. The corresponding form field (created by default) shows: entity type: sting and Type: text field.

In TF file, attempting to send an array of strings (either using a comma-separated list or even another complex terraform types like a list - using string values).
When running terraform apply get the error

Error: vra7_deployment.LB: deployment_configuration (IPAddresses): '' expected type 'string', got unconvertible type '[]interface {}'

Additionally, attempt to pass a single, simple string allows us to pass the terraform plan step, but fails during the apply as the value doesn't actually get ingested into the XaaS blueprint. The vRO log shows a 'not set' as the value for the array/string input.

To Reproduce Steps to reproduce the behavior:

  1. Create a simple XaaS blueprint based upon a vRO workflow with one of the inputs set as a array/string data type.
  2. In TF, attempt to pass an array of strings (or list) and run a terraform plan.
  3. Get the error ' expected type 'string', got unconvertible type '[]interface {}'
  1. Create a simple XaaS blueprint based upon a vRO workflow with one of the inputs set as a array/string data type.
  2. In TF, attempt to pass a simple, single string value and run a terraform apply.
  3. Provision of XaaS blueprint will show array/string input value as 'not set'.

Expected behavior Passing an array of strings in a Terraform tf file should properly send the data to a XaaS blueprint with an input field of type array/string.

Logs No vra-terraform.log at terraform plan step.

If attempting to pass single string, see vra-terraform.log attached. vra-terraform.log

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

jripault commented 5 years ago

Same problem here, but as the provider use a simple format (string for all fields), I don't think it could be adapted this easily. I'm trying some tweaks but no good for the moment

jripault commented 5 years ago

Seems like you need to implement your own resource because of typing. Can the devs confirm ?

jonnyborbs commented 5 years ago

@Prativa20 can you take a look at this?

jonnyborbs commented 5 years ago

@Prativa20 @markpeek I'm on the phone with @javansickle right now - can we take a look at this? Seems like a data type mismatch

Prativa20 commented 5 years ago

@vaficionado @javansickle looking into it..will update soon