Workspaces as code (WAC) brings the infrastructure as code paradigm to Coder environments. WAC allows you to define and create new environments using workspace templates.
Workspace templates are declarative YAML files that describe how to configure environments and their supporting infrastructure.
Requirements
- You must configure a GitHub or GitLab OAuth service
- The image you use in your template must have been imported into Coder
- A
.coder/coder.yamlfile exists in your repository.
Creating a workspace template
You can find a fully populated workspace template and descriptions of each field in our syntax guide.
Adding an embeddable button
To make it easy for your developers to use your template, you can generate an embeddable Markdown button for use in your repo. See the admin guide for details.

