terraform-provider-tfe
terraform-provider-tfe copied to clipboard
data source should allow wildcard for matching searches
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
}