vmware / terraform-provider-vra

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

vra_project -> zone_assignments ignore multiple values #305

Closed MichalZezula closed 3 years ago

MichalZezula commented 3 years ago

vRA version vRealize Automation 8.2.0.13070 (17151459) Terraform version Terraform v0.14.5 terraform-provider-vra plugin version provider registry.terraform.io/vmware/vra v0.3.4

Describe the bug zone_assignments in vra_project data resource do not display more than one zone assignment

To Reproduce Steps to reproduce the behavior:

Expected behavior I expect to see all zone assignments as visible in web ui

Screenshots image image

Desktop (please complete the following information):

Prativa20 commented 3 years ago

Hi @MichalZezula I am not able to reproduce it with the latest version. Can you please verify it once again? Screen Shot 2021-02-11 at 11 11 50 AM

MichalZezula commented 3 years ago

Hello, Just to be sure I've updated Terraform to the very latest version -> 14.6 . I've tried it again but seeing the same result. I've also tried to define project in terraform with multiple zone assignments and this seems to work perfectly fine. But when I try to fetch these informations using data resource I'm seeing only one of the assignments.

vra_project_redacted.tfstate.txt

Prativa20 commented 3 years ago

@MichalZezula I could reproduce this issue. This looks like a terraform issue and not a provider issue. In the schema, zone_assignments is a TypeSet that might be causing all the zones to be not saved in the state file. I changed the data type to TypeList and it works fine. I have opened a terraform bug for this https://github.com/hashicorp/terraform/issues/28169

There was a similar issue opened before as well https://github.com/hashicorp/terraform/issues/21157

However, I will do some more testing to see nothing breaks before changing it to TypeList.

Thanks, Prativa

Prativa20 commented 3 years ago

The PR for this fix is merged https://github.com/vmware/terraform-provider-vra/pull/315 It will be available in the next release.