terraform-provider-tfe icon indicating copy to clipboard operation
terraform-provider-tfe copied to clipboard

data source should allow wildcard for matching searches

Open scottwinkler opened this issue 3 years ago • 0 comments

If i want to get all workspaces that end with *-prod I currently have to write an ugly for expression like so:

data "tfe_workspace_ids" "all" {
  for_each     = local.organizations
  names        = ["*"]
  organization = each.key
}

  dev_ws = {for v in data.tfe_workspace_ids.all : v.organization => [for name in v.full_names : name if try(length(regex(".*-prod",name))>0,false)]}

would be great if i could do the following instead:

data "tfe_workspace_ids" "prod" {
  for_each     = local.organizations
  names        = ["*-prod"]
  organization = each.key
}

scottwinkler avatar Feb 20 '21 07:02 scottwinkler