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

tfe_workspace_ids support to filter excluding specific tags #393

Closed
devopsrick opened this issue Nov 17, 2021 · 3 comments · Fixed by #523
Closed

tfe_workspace_ids support to filter excluding specific tags #393

devopsrick opened this issue Nov 17, 2021 · 3 comments · Fixed by #523

Comments

@devopsrick
Copy link

devopsrick commented Nov 17, 2021

It would be nice to be able to exclude specific tags from the data source. i.e. all workspaces with tags "aws" and "app" but NOT "prod".

data "tfe_workspace_ids" "non-prod-apps" {
  tag_names    = [!"prod", "app", "aws"]
  organization = "my-org-name"
}
@devopsrick
Copy link
Author

I did accomplish the same effect by using setsubtract(), but it would be much cleaner if the data lookup supported the idea of excluding specific tags from the results.

setsubtract(values(data.tfe_workspace_ids.aws.ids), values(data.tfe_workspace_ids.aws_prod.ids))

@sebasslash
Copy link
Contributor

sebasslash commented Jun 9, 2022

We can add a exclude_tags field to this data source that will locally filter from the returned set. How does this sound?

@brandonc
Copy link
Collaborator

brandonc commented Dec 23, 2022

This was released as part of v0.32.0 earlier this year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants