vmware / terraform-provider-vcd

Terraform VMware Cloud Director provider
https://www.terraform.io/docs/providers/vcd/
Mozilla Public License 2.0
148 stars 112 forks source link

data source vcd_catalog_item: Allow wildcard (if possible) and add output attributes #331

Closed jpbuecken closed 2 weeks ago

jpbuecken commented 5 years ago

Hello, is it possible to expand the new vcd_catalog_item data source with the following?

Not sure, but does the API allow Wildcards (Similar to the "filter" Option from the AWS API?). If yes, is it possible to allow Wildcards in Catalog Item Name (Abort with multiple matches, similar to https://www.terraform.io/docs/providers/aws/d/ami.html. Or you implement a new data source vcd_catalog_items and save result in array, similar to https://www.terraform.io/docs/providers/aws/d/ami_ids.html )

data vcd_catalog_items myimage {
        name = "some_vm*"
}

In addition (and maybe more useful because we can reference it again in the VM) you may add output/attributes catalog_name, template_name, e.g.

resource "vcd_vapp_vm" "myinstance" {
  catalog_name  = data.vcd_catalog_items.myimage[0].catalog_name
  template_name = data.vcd_catalog_items.myimage[0].template_name
[...]
}

Wildcard Support is nice to have, the attributes would be more useful for us.

jpbuecken commented 2 weeks ago

I think the filter parameter introduced in vcd_catalog_item and vcd_catalog_vapp_template matches my use case of that time.

From my point of view, you can close this issue.