- Notifications
You must be signed in to change notification settings - Fork3
chore: update readme, add version warnings, examples#71
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,35 @@ | ||
#terraform-provider-coderd | ||
`terraform-provider-coderd` enables managing a [Coder](https://github.com/coder/coder) deployment using [Terraform](https://github.com/hashicorp/terraform) IaC. | ||
The provider currently supports resources and data sources for: | ||
- Users | ||
- Templates + Template Versions | ||
- Groups | ||
- Workspace Proxies | ||
- Organizations (Data Source only) | ||
## Requirements | ||
- [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0 | ||
- [Go](https://golang.org/doc/install) >= 1.21 | ||
- [Coder](https://github.com/coder/coder) >= 2.10.1 | ||
ethanndickson marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
## Usage | ||
See the [`examples`](examples) and the [documentation](https://registry.terraform.io/providers/coder/coderd/latest/docs). | ||
## Developing the Provider | ||
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above). | ||
To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory. | ||
To generate or update documentation, run `make gen`. | ||
### TerraformAcceptanceTests | ||
Acceptance testsare run against a live Coder deployment in a local Docker container. Torun the full suite of Acceptance tests, run `make testacc`. | ||
> [!NOTE] | ||
> Our [CI workflow](./github/workflows/test.yml) runs an acceptance test matrix against multiple Terraform versions. |
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Provider populated from environment variables | ||
provider "coderd" {} | ||
resource "coderd_user" "coder1" { | ||
username = "coder1" | ||
name = "Coder One" | ||
email = "coder1@coder.com" | ||
} | ||
resource "coderd_user" "coder2" { | ||
username = "coder2" | ||
name = "Coder One" | ||
email = "coder2@coder.com" | ||
} | ||
// Add two users to the group by their ID. | ||
resource "coderd_group" "group1" { | ||
name = "group1" | ||
members = [ | ||
coderd_user.coder1.id, | ||
coderd_user.coder2.id | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Provider populated from environment variables | ||
provider "coderd" {} | ||
// Get the commit SHA of the configuration's git repository | ||
variable "TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA" { | ||
type = string | ||
} | ||
resource "coderd_user" "coder1" { | ||
username = "coder1" | ||
name = "Coder One" | ||
email = "coder1@coder.com" | ||
} | ||
resource "coderd_template" "ubuntu-main" { | ||
name = "ubuntu-main" | ||
description = "The main template for developing on Ubuntu." | ||
versions = [ | ||
{ | ||
name = "stable-${var.TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA}" | ||
description = "The stable version of the template." | ||
directory = "./stable-template" | ||
}, | ||
{ | ||
name = "staging-${var.TFC_CONFIGURATION_VERSION_GIT_COMMIT_SHA}" | ||
description = "The staging version of the template." | ||
directory = "./staging-template" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Provider populated from environemnt variables | ||
provider "coderd" {} | ||
// Create a bot user for Jenkins | ||
resource "coderd_user" "jenkins" { | ||
username = "jenkins" | ||
name = "Jenkins CI/CD" | ||
email = "ci@example.com" | ||
roles = ["template-admin"] | ||
login_type = "none" | ||
} | ||
// Keep the password of a user account up to date from an external source | ||
resource "coderd_user" "audit" { | ||
username = "auditor" | ||
name = "Auditor" | ||
email = "security@example.com" | ||
roles = ["auditor"] | ||
login_type = "password" | ||
password = data.vault_password.auditor.value | ||
} | ||
// Ensure the admin account is suspended | ||
resource "coderd_user" "admin" { | ||
username = "admin" | ||
suspended = true | ||
} |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.