terraform-provider-vcd
terraform-provider-vcd copied to clipboard
Unable to reference specific catalog if there are multiple ones with the same name
Catalog sharing allows having multiple catalogs with the same name accessible to a single org. In this case there isn't a way to select a specific one when referencing it in the vcd_vm or vcd_vapp_vm resource.
Maybe we shouldn' t use org.GetCatalogByName but some more specific function like org.GetCatalogId or org.GetCatalogByNameOrId
https://github.com/vmware/terraform-provider-vcd/blob/89bcdc8abb7a31d33e972b02f94a077da93ccb93/vcd/resource_vcd_vapp_vm.go#L634
Hello @schmaxit You are right, we should use ID instead of names.
Catalogs names are unique per Orgs, so probably when that code was develop, the sharing feature wasn't yet in VCD. We are aware of the situation ad for us is technical debt that at some point needs to be addressed.
Closing this as v3.8.0 has vcd_catalog_vapp_template and vcd_vapp_vm
accept its ID instead of names.