Skip to content

Commit bc7db22

Browse files
stirbymatifali
authored andcommitted
started 'extending templates' rearranged resource persistence
1 parent d47245b commit bc7db22

File tree

5 files changed

+44
-10
lines changed

5 files changed

+44
-10
lines changed

docs/admin/templates/concepts.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Extending templates
2+
3+
There are a variety of Coder-native features to extend the configuration of your development environments.
4+
5+
<!-- TODO: May divide into sub-pages later. -->
6+
7+
## Workspace agents
8+
9+
## Resource persistence
10+
11+
The resources you define in a template may be _ephemeral_ or _persistent_. Persistent resources stay provisioned when workspaces are stopped, where as ephemeral resources are destroyed and recreated on restart. All resources are destroyed when a workspace is deleted.
12+
13+
> You can read more about how resource behavior and workspace state in the [workspace lifecycle documentation](../workspaces/lifecycle.md).
14+
15+
Template resources follow the [behavior of Terraform resources](https://developer.hashicorp.com/terraform/language/resources/behavior#how-terraform-applies-a-configuration) and can be further configured  using the [lifecycle argument](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle).
16+
17+
### Example usage
18+
19+
A common configuration is a template whose only persistent resource is the home directory. This allows the developer to retain their work while ensuring the rest of their environment is consistently up-to-date on each workspace restart.
20+
21+
22+
## Template variables
23+
24+
## Parameters
25+
26+
## Coder apps
27+
28+
### App ordering
29+
30+
## Agent metadata
31+
32+
33+
<children>
34+
35+
</children>

docs/admin/templates/managing-templates.md

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ infrastructure, software, or security patches. Learn more about
5858

5959
![Updating a template](../../images/templates/update.png)
6060

61+
### Template update policies (enterprise)
62+
63+
Enterprise template admins may want workspaces to always remain on the latest version of their parent template. To do so, enable **Template Update Policies** in the template's general settings. All non-admin users of the template will be forced to update their workspaces before starting them once the setting is applied. Workspaces which leverage autostart or start-on-connect will be automatically updated on the next startup.
64+
65+
![Template update policies](../../images/templates/update-policies.png)
66+
6167
## Delete templates
6268

6369
You can delete a template using both the coder CLI and UI. Only

docs/admin/workspaces/lifecycle.md

+3-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ This page covers how workspaces move through this lifecycle. To learn about auto
77

88
## Workspace ephemerality
99

10-
In Coder, your workspaces are composed of resources which may be _ephemeral_ or _persistent_. Persistent resources stay provisioned when the workspace is stopped, where as ephemeral resources are destroyed and recreated on restart. All resources are destroyed when a workspace is deleted.
10+
Workspaces are composed of resources which may be _ephemeral_ or _persistent_. Persistent resources stay provisioned when the workspace is stopped, where as ephemeral resources are destroyed and recreated on restart. All resources are destroyed when a workspace is deleted.
1111

12-
A common example of their usage is to have a workspace whose only persistent resource is the home directory. This allows the developer to retain their work while ensuring the rest of their environment is consistently up-to-date on each workspace restart.
13-
14-
The persistence of resources in your workspace is determined by Terraform in your template. Read more from the official documentation on [Terraform resource behavior](https://developer.hashicorp.com/terraform/language/resources/behavior#how-terraform-applies-a-configuration) and how to configure it using the [lifecycle argument](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle).
15-
16-
<!-- TODO: Template resource persistence link
17-
https://coder.com/docs/templates/resource-persistence
18-
-->
12+
> Template administrators can learn more about resource configuration in the [extending templates docs](../templates/concepts.md).
1913
2014
## Workspace States
2115

@@ -73,7 +67,7 @@ Typically, when a workspace is deleted, all of the workspace's resources are del
7367

7468
During a workspace start or stop build, one of two errors may lead to a broken state. If the call to `terraform apply` fails to correctly provision resources, a workspace build has **failed**. If the computational resources fail to connect the agent, a workspace becomes **unhealthy**.
7569

76-
A failed workspace is most often caused by misalignment from the definition in your template's Terraform file and the target resources on your infrastructure. Unhealthy workspaces are usually caused by a misconfiguration in the agent or startup scripts it runs.
70+
A failed workspace is most often caused by misalignment from the definition in your template's Terraform file and the target resources on your infrastructure. Unhealthy workspaces are usually caused by a misconfiguration in the agent or workspace startup scripts.
7771

7872
<!-- TODO: Needs review/addition -->
7973

docs/admin/workspaces/schedule.md

-1
This file was deleted.
91.2 KB
Loading

0 commit comments

Comments
 (0)