Skip to content

Add support for {category: name} tag filtering to d/vsphere_compute_cluster #2607

@akli-ime

Description

@akli-ime

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Currently, the vsphere_compute_cluster data source cannot filter clusters by their assigned vSphere tags. In environments with many clusters, selecting clusters based on tags such as OS, environment, or licensing is critical for automation, compliance, and operational workflows.

We propose adding a tag_filters argument to the data source that accepts a dictionary of ```` { category: name }```. The data source should return only clusters that have all specified tags in the corresponding categories.

Use Case(s)

  • Selecting clusters based on environment (env: production) to provision workloads only on clusters in a specific environment.
  • Filtering clusters by OS license type, exemple : (license: windows).
  • Enabling reliable and safe automation workflows that depend on operational tags for cluster selection.

Potential Configuration

data "vsphere_compute_cluster" "filter_by_tags" {
  tag_filters = {
    "os"  = "windows"
    "env" = "production"
  }
}

References

vsphere_cluster_tag_poc.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions