coder / terraform-provider-coderd

Manage a Coder deployment using Terraform
https://registry.terraform.io/providers/coder/coderd/latest/docs
Mozilla Public License 2.0
10 stars 2 forks source link

Support installing coder and using provider in single terraform apply #144

Open f0ssel opened 2 weeks ago

f0ssel commented 2 weeks ago

Currently the provider requires you provide an authentication token on initialization. If you do something like a helm_release of coder, it is currently not possible to also manage resources on the coder installation in the same terraform apply step because you do not have an authentication token yet. You would need to install coder in one step, login or make a new api key, and then run another terraform apply step for the terraform-provider-coderd resources.

Ideally a user can install coder and manage it's resources in the same step by allowing the user to create the "first coder user" and then login with that user for the provider.

One idea of how this could possibly look:

provider "coderd" {
  url   = "coder.example.com"
  email = "admin@coder.com"
  password = "SomeSecurePassword!"
  username = "Admin"
  create_first_user = true
}