spacelift-io / terraform-provider-spacelift

Terraform provider to interact with Spacelift
MIT License
74 stars 28 forks source link

Request: spacelift_contexts data source label filter #389

Closed dylan-turnbull closed 1 year ago

dylan-turnbull commented 1 year ago

The spacelift_contexts could be improved with the option to supply labels that would be used to filter the returned list of contexts.

While the list can be filtered after being returned by the provider, provider side filtering would result in much cleaner Terraform configuration

# An example of what the implementation could look like
data "spacelift_contexts" "contexts" {
  labels = [
    "production",
    "vault"
  ]
}
# An example of similar functionality in the AWS Terraform provider.
data "aws_subnets" "private" {
  tags = {
    Tier = "Private"
  }
}
marcinwyszynski commented 1 year ago

Make sense, I'll take this one.

marcinwyszynski commented 1 year ago

This is released in 0.1.37.