* docs: rework our "templates" section * wikistuff * fix formatting * add diagram * reorganize some things * docs: improve workspaces and templates doc (#9139) * Reorg, updated/new screenshots, consistent terminology * First pass * Another pass * Added integration section * New outline for template pages, small updates * Revised outline for templates, added tutorial * First pass at tutorial * Some feedback from Ben. * Update docs/workspaces.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/workspaces.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/workspaces.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Fixed typos * Expanded tutorial I have read the CLA Document and I hereby sign the CLA * New screenshots, improved tutorial, revised anatomy * Improved tutorial. Anatomy is now a guided tour. * First pass at guided tour * Updated authentication info * Reorganized the guided tour * Edited more template pages * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tutorial.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Update docs/templates/tour.md Co-authored-by: Muhammad Atif Ali <matifali@live.com> * Revised devcontainers and docker-in-workspaces * Edited and added screenshots * Prepared first draft, except docs/templates/open-in-coder.md * Fix typo * remove legacy parameters and migration guide * Use coder templates create * Added screenshot for workspace template variables * Made it prettier * Fixed minor typos and markdown problems * edits to repairing workspaces * fix broken links in product * Added troubleshooting, minor corrections. * fix terminal links * fmt --------- Co-authored-by: Muhammad Atif Ali <matifali@live.com> Co-authored-by: Ben Potter <me@bpmct.net> Co-authored-by: Atif Ali <atif@coder.com> * make fmt * fix merge conflict * make fmt * make gen * update * lint * Discard changes to coderd/database/queries.sql.go * Discard changes to cli/templates.go * Discard changes to cli/templateversionarchive.go * Discard changes to cli/templateversions.go * Update docker-in-workspaces.md * replace ```sh with ```shell * open-in-coder * fmt * mention coder_metadata in icons.md * resource_metadata * use shell * modules.md * mention coder registry module * workspace.md * resource_metadata * remove duplication * address comments * cleanup * fmt * fix broken links * fix numbering * mention module registry * add example * demote heading * remove top level entry from manifest * fmt --------- Co-authored-by: Ben <me@bpmct.net> Co-authored-by: Marc Paquette <22124737+marcpaq@users.noreply.github.com>
3.2 KiB
Working with templates
You create and edit Coder templates as Terraform configuration
files (.tf
) and any supporting files, like a README or configuration files for
other services.
Who creates templates?
The Template Admin role (and above) can create templates. End users, like developers, create workspaces from them.
Templates can also be managed with git, allowing any developer to propose changes to a template.
You can give different users and groups access to templates with role-based access control.
Starter templates
We provide starter templates for common cloud providers, like AWS, and orchestrators, like Kubernetes. From there, you can modify them to use your own images, VPC, cloud credentials, and so on. Coder supports all Terraform resources and properties, so fear not if your favorite cloud provider isn't here!
If you prefer to use Coder on the command line, use
coder templates init
.
Coder starter templates are also available on our GitHub repo.
Community Templates
As well as Coder's starter templates, you can see a list of community templates by our users here.
Editing templates
Our starter templates are meant to be modified for your use cases. You can edit any template's files directly in the Coder dashboard.
If you'd prefer to use the CLI, use coder templates pull
, edit the template
files, then coder templates push
.
Even if you are a Terraform expert, we suggest reading our guided tour.
Updating templates
Coder tracks a template's versions, keeping all developer workspaces up-to-date. When you publish a new version, developers are notified to get the latest infrastructure, software, or security patches. Learn more about change management.
Delete templates
You can delete a template using both the coder CLI and UI. Only template admins and owners can delete a template, and the template must not have any running workspaces associated to it.
In the UI, navigate to the template you want to delete, and select the dropdown in the right-hand corner of the page to delete the template.
Using the CLI, login to Coder and run the following command to delete a template:
coder templates delete <template-name>
Delete workspaces
When a workspace is deleted, the Coder server essentially runs a terraform destroy to remove all resources associated with the workspace.
Terraform's prevent-destroy and ignore-changes meta-arguments can be used to prevent accidental data loss.