data vsphere_datacenter "this" {
for_each = toset(var.vmw_region_name)
name = each.value
}
// Required for vRA Cloud, Optional for vRA 8.X
data "vra_data_collector" "this" {
count = var.data_collector_name != "" ? 1 : 0
name = var.data_collector_name
}
resource "vra_cloud_account_vsphere" "this" {
name = var.vmw_cloud_account_name
description = var.vmw_cloud_account_description
hostname = var.vmw_hostname
username = var.vmw_username
password = var.vmw_password
regions = [for v in data.vsphere_datacenter.this: format("Datacenter:%s", v.id)]
accept_self_signed_cert = true
associated_cloud_account_ids = [var.associated_cloud_account_ids]
// Required for vRA Cloud, Optional for vRA 8.X
dc_id = var.data_collector_name != "" ? data.vra_data_collector.this[0].id : ""
tags {
key = "platform"
value = "vsphere"
}
tags {
key = "cloud type"
value = "private"
}
}
Expected Behavior
Once created, a rerun of main configuration would detect no changes
Actual Behavior
When specifing the dc_id it appears to write the value to dcid. Unfortunately a rerun of terraform sees dc_id as empty and recogizes a change. Subsequent runs fail.
Steps to Reproduce
terraform apply
terraform apply (second run fails everytime)
Screenshots
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Code of Conduct
This project has a Code of Conduct that all participants are expected to understand and follow:
vRA Version
vRA Cloud
Terraform Version
v1.3.2
vRA Terraform Provider Version
v0.6.0
Affected Resource(s)
vra_cloud_account_vsphere
Terraform Configuration Files
terraform { required_providers { vra = { source = "vmware/vra" } } }
provider "vsphere" { user = var.vmw_username password = var.vmw_password vsphere_server = var.vmw_hostname allow_unverified_ssl = true }
data vsphere_datacenter "this" { for_each = toset(var.vmw_region_name) name = each.value }
// Required for vRA Cloud, Optional for vRA 8.X
data "vra_data_collector" "this" { count = var.data_collector_name != "" ? 1 : 0 name = var.data_collector_name }
resource "vra_cloud_account_vsphere" "this" { name = var.vmw_cloud_account_name description = var.vmw_cloud_account_description hostname = var.vmw_hostname username = var.vmw_username password = var.vmw_password regions = [for v in data.vsphere_datacenter.this: format("Datacenter:%s", v.id)] accept_self_signed_cert = true associated_cloud_account_ids = [var.associated_cloud_account_ids]
// Required for vRA Cloud, Optional for vRA 8.X dc_id = var.data_collector_name != "" ? data.vra_data_collector.this[0].id : ""
tags { key = "platform" value = "vsphere" } tags { key = "cloud type" value = "private" } }
Expected Behavior
Once created, a rerun of main configuration would detect no changes
Actual Behavior
When specifing the dc_id it appears to write the value to dcid. Unfortunately a rerun of terraform sees dc_id as empty and recogizes a change. Subsequent runs fail.
Steps to Reproduce
Screenshots
Community Note