Skip to content

Commit b5b74b0

Browse files
committed
modules.md
1 parent 20bd888 commit b5b74b0

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

docs/templates/modules.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,54 @@ coder:
107107
subPath: .git-credentials
108108
readOnly: true
109109
```
110+
111+
## Artifactory
112+
113+
JFrog Artifactory can serve as a Terraform module registry, allowing you to
114+
simplify a Coder-stored template to a `module` block and input variables.
115+
116+
With this approach, you can:
117+
118+
- Easily share templates across multiple Coder instances
119+
- Store templates far larger than the 1MB limit of Coder's template storage
120+
- Apply JFrog platform security policies to your templates
121+
122+
### Basic Scaffolding
123+
124+
For example, a template with:
125+
126+
```hcl
127+
module "frontend" {
128+
source = "cdr.jfrog.io/tf__main/frontend/docker"
129+
}
130+
```
131+
132+
References the `frontend` module in the `main` namespace of the `tf` repository.
133+
Remember to replace `cdr.jfrog.io` with your Artifactory instance URL.
134+
135+
You can upload the underlying module to Artifactory with:
136+
137+
```shell
138+
# one-time setup commands
139+
# run this on the coder server (or external provisioners, if you have them)
140+
terraform login cdr.jfrog.io; jf tfc --global
141+
142+
# jf tf p assumes the module name is the same as the current directory name.
143+
jf tf p --namespace=main --provider=docker --tag=v0.0.1
144+
```
145+
146+
### Example template
147+
148+
We have an example template
149+
[here](https://github.com/coder/coder/tree/main/examples/templates/jfrog/remote)
150+
that uses our [JFrog Docker](../platforms/jfrog.md) template as the underlying
151+
module.
152+
153+
### Next up
154+
155+
Learn more about
156+
157+
- JFrog's Terraform Registry support
158+
[here](https://jfrog.com/help/r/jfrog-artifactory-documentation/terraform-registry).
159+
- Configuring the JFrog toolchain inside a workspace
160+
[here](../platforms/jfrog.md).

0 commit comments

Comments
 (0)