Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE REQUEST - Dynamic Datasources #937

Closed
stobias123 opened this issue Dec 31, 2019 · 6 comments
Closed

FEATURE REQUEST - Dynamic Datasources #937

stobias123 opened this issue Dec 31, 2019 · 6 comments
Labels
enhancement Type: Enhancement

Comments

@stobias123
Copy link

I'm using this provider more and more lately. Support has gotten better, and it really helps align vmware infrastructure with the SDDC ideology vmware is pushing, and thus infrastructure as code through terraform.

However, the data sources from this provider are lacking when compared to providers like aws or gcp or any cloud provider.

I would like to dynamically retrieve available resources from vmware using a filter similar to
aws_ami datasource and aws_subnet_ids data source.

VMWare tags should be sufficient for filters, and would really help push this provider (and vmware) to the next level if such functionality was added.

Suggested First Resource(s)

Please list the resources as a list, for example:

  • vsphere_virtual_machine - for finding templates.
  • vsphere_datastore_cluster - for finding datastores via tags (eg. SRM tag :) )

Example

This is how I'd imagine the vsphere_virtual_machine working.

data "vsphere_virtual_machine" "rhel_template_prod" {
  datacenter_id = "${data.vsphere_datacenter.datacenter.id}"
  most_recent      = true
  name_regex       = "^GOLD.+"

  filter {
    key   = "operating_system"
    values = ["rhel"]
  }
}

Important Factoids

Other cloud providers have this functionality. The lack of dynamic datasources is holding this provider back.

@aareet aareet added the enhancement Type: Enhancement label Jan 10, 2020
@bill-rich
Copy link
Contributor

Hi @stobias123! I like the idea of adding support for this type of filtering as it could help make it easier to find an object based on something besides the name. We'd need to look a bit more into it to see if there would be any other implications to making a change like this. Best case though, we'd be able to do something like this in the 2.0 release (which doesn't have a planned date yet), since it would be a breaking change to existing configurations.

I'll get a tag on this to look at when we're looking at what to work on and include in that release. Thank you for the suggestion!

@bill-rich bill-rich added the v2.0 label Jan 15, 2020
@aareet aareet removed the v2.0 label Apr 14, 2020
@minhluantran017
Copy link

This is exactly the feature that I'm looking for now. Waiting for it to be supported.

@stobias123
Copy link
Author

@bill-rich - I saw this was removed from v2.0 - was it decided not to work on this feature?

@bill-rich
Copy link
Contributor

@stobias123 It is actually nearly done. Though it is implemented slightly different. It should make it into the release this week or next.

@bill-rich
Copy link
Contributor

Completed in #1103

@ghost
Copy link

ghost commented Jul 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Jul 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants