@@ -23,8 +23,6 @@ vim <template-name>/main.tf
23
23
coder templates < create/update> < template-name>
24
24
```
25
25
26
- > We recommend source controlling your templates.
27
-
28
26
## Persistent and ephemeral resources
29
27
30
28
Coder supports both ephemeral and persistent resources in workspaces. Ephemeral
@@ -53,6 +51,42 @@ Templates often contain *parameters*. In Coder, there are two types of parameter
53
51
each workspace, often personalization settings such as "preferred
54
52
region" or "workspace image".
55
53
54
+
55
+ ## Best Practices
56
+
57
+ ### Template Changes
58
+
59
+ We recommend source controlling your templates.
60
+
61
+ ### Authenticating with Cloud Providers
62
+
63
+ Coder's provisioner process needs to authenticate with cloud provider APIs to provision
64
+ workspaces. We strongly advise against including credentials directly in your templates. You
65
+ can either pass credentials to the provisioner as parameters, or execute Coder
66
+ in an environment that is authenticated with the cloud provider.
67
+
68
+ We encourage the latter where supported. This approach simplifies the template, keeps cloud
69
+ provider credentials out of Coder's database (making it a less valuable target for attackers),
70
+ and is compatible with agent-based authentication schemes (that handle credential rotation
71
+ and/or ensure the credentials are not written to disk).
72
+
73
+ Cloud providers for which the Terraform provider supports authenticated environments include
74
+
75
+ * [ Google Cloud] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs )
76
+ * [ Amazon Web Services] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs )
77
+ * [ Microsoft Azure] ( https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs )
78
+ * [ Kubernetes] ( https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs )
79
+
80
+ Additional providers may be supported; check the
81
+ [ documentation of the Terraform provider] ( https://registry.terraform.io/browse/providers ) for
82
+ details.
83
+
84
+ The way these generally work is via the credentials being available to Coder either in some
85
+ well-known location on disk (e.g. ` ~/.aws/credentials ` for AWS on posix systems), or via
86
+ environment variables. It is usually sufficient to authenticate using the CLI or SDK for the
87
+ cloud provider before running Coder for this to work, but check the Terraform provider
88
+ documentation for details.
89
+
56
90
---
57
91
58
92
Next: [ Workspaces] ( ./workspaces.md )
0 commit comments