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

Show which user was queried when users_not_found returned by data source #69

Closed
edify42 opened this issue Sep 27, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@edify42
Copy link
Contributor

edify42 commented Sep 27, 2021

Hi @pablovarela !

We use the datasource like below for a number of users who signin via SSO and we maintain a list of them with terraform that can do other things like below:

data "slack_user" "by_email" {
  for_each = toset(flatten([
    [var.users_in_teams["team_x"]],
    [var.users_in_teams["team_y"]],
    [var.users_in_teams["team_z"]],
    [var.users_in_teams["team_a"]],
    [var.users_in_teams["team_b"]]
  ]))
  email = each.key
}

Sometimes people leave our org and their email is no longer valid in slack. The provider currently returns the below:

Error: users_not_found

  on users-slack-info.tf line 1, in data "slack_user" "by_email":
   1: data "slack_user" "by_email" {

Without the detail into which user left. making it hard for us to figure it out quickly. I can make a PR to output which user it was that left (either their name or email)

@pablovarela
Copy link
Owner

Implemented by #70

@edify42
Copy link
Contributor Author

edify42 commented Sep 28, 2021

Thanks mate ❤️

Error: not found [email protected]: users_not_found

  on users-slack-info.tf line 1, in data "slack_user" "by_email":
   1: data "slack_user" "by_email" {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants