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

Resource coderd_user: Plan fails when user was deleted outside of terraform #208

Open
michvllni opened this issue Apr 11, 2025 · 0 comments

Comments

@michvllni
Copy link

michvllni commented Apr 11, 2025

When a user created via the coderd provider is removed outside of terraform, the plan fails because it cannot find the user.

resource "coderd_user" "user" {
  username = "myuser"
  email = "myuser@myorg.com"
  name = "My User"
  roles = []
  login_type = "oidc"
}
╷
│ Error: Client Error
│ 
│   with coderd_user.user,
│   on users.tf line 1, in resource "coderd_user" "user":
│    1: resource "coderd_user" "user" {
│ 
│ Unable to get current user, got error: GET
│ https://<REDACTED url>/api/v2/users/<REDACTED user id>:
│ unexpected status code 400: "user" must be an existing uuid or username.
│ 	Error: queried user="<REDACTED user id>"
╵

I would have expected the provider to mark this as deleted instead of running into an error

@michvllni michvllni changed the title Plan fails when user was deleted outside of terraform Resource coderd_user: Plan fails when user was deleted outside of terraform Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant