coder icon indicating copy to clipboard operation
coder copied to clipboard

expose Coder objects in the terraform provider

Open ericpaulsen opened this issue 2 years ago • 3 comments

multiple customers have inquired about creating the following objects using our Terraform provider:

  • users
  • groups
  • template/group RBAC mapping

a common theme across these customers: Terraform is used to configure all of their applications, so they'd like Coder to be fully configurable as code.

Tasks:

  • [x] https://github.com/coder/coder/issues/13007
  • [x] Create coderd provider skeleton
  • [x] Create integration test framework for coderd provider
  • [x] Add user and group management capability to coderd provider
  • [x] Add template and template version management capability to coderd provider
  • [x] Add workspace proxy management capability to coderd provider
  • [ ] Add license management capability to coderd provider
  • [ ] (?) Add custom role management capability to coderd provider
  • [ ] (?) Add organization management capability to coderd provider

ericpaulsen avatar Sep 29 '23 17:09 ericpaulsen

Nice. We don't have any short-term plans to make it so that people can provision Coder users, groups, or permissions with Terraform.

With group and role sync, the identity provider becomes the source of truth for authentication and authorization. I believe this should probably remain the case, versus it being done via Terraform, but Terraform can be used to deploy Coder with group sync enabled with coder server environment variables.

One side-effect is, sadly, that an initial admin user has to be created via some sort of script. It can be immediately deleted though. We should make that story better.

We don't have a good solution for codifying template permissions mapping though. Right now, sadly, a script is probably the best bet

bpmct avatar Oct 04 '23 14:10 bpmct

re-opening - as this is a major point of feedback from customers.

ericpaulsen avatar Apr 10 '24 00:04 ericpaulsen

I would suggest developing the new coderd provider with https://developer.hashicorp.com/terraform/plugin/framework so that we do not have to migrate it later

matifali avatar May 29 '24 16:05 matifali