|
| 1 | +--- |
| 2 | +title: Terraform |
| 3 | +description: Learn how to deploy Coder using Terraform. |
| 4 | +--- |
| 5 | + |
| 6 | +Coder offers [Terraform modules](https://github.com/cdr/enterprise-terraform) |
| 7 | +that help you deploy Coder faster. |
| 8 | + |
| 9 | +Currently, we offer a single-command deployment of Coder to Google Cloud |
| 10 | +Platform. We will add support for additional cloud providers in the future. |
| 11 | + |
| 12 | +## Deploying Coder to Google Cloud Platform |
| 13 | + |
| 14 | +> Before proceeding, please make sure that you have both |
| 15 | +> [Terraform](https://www.terraform.io/downloads.html) and |
| 16 | +> [Terragrunt](https://terragrunt.gruntwork.io/docs/getting-started/quick-start/) |
| 17 | +> installed. |
| 18 | +
|
| 19 | +1. [Copy the GKE example](https://github.com/cdr/enterprise-terraform/tree/main/examples/gke/self-hosted) |
| 20 | + to the location of your choice (we recommend version controlling the entire |
| 21 | + folder). |
| 22 | + |
| 23 | +1. [Create a cloud DNS zone](https://cloud.google.com/dns/docs/quickstart) |
| 24 | + containing your desired hostname. This must be in the same GCP project where |
| 25 | + you will deploy Coder. |
| 26 | + |
| 27 | +1. Update the `terragrunt.hcl` file that's included in the root of your example |
| 28 | + folder. The `terragrunt.hcl` file contains notes that will guide you through |
| 29 | + customization options available. When done, you can view the changes you |
| 30 | + proposed running: |
| 31 | + |
| 32 | + ```console |
| 33 | + terragrunt run-all plan |
| 34 | + ``` |
| 35 | + |
| 36 | + If you run the above command and it fails, you may have misconfigured one or |
| 37 | + more of the variables required. The output will direct you to the problematic |
| 38 | + areas. |
| 39 | + |
| 40 | +1. Deploy Coder by running: |
| 41 | + |
| 42 | + ```console |
| 43 | + terragrunt run-all apply |
| 44 | + ``` |
| 45 | + |
| 46 | + If the `apply` command succeeds, you will be able to access Coder at the |
| 47 | + hostname you provided. Log in with `admin` as the username and the password |
| 48 | + that you're provided. |
| 49 | + |
| 50 | +## Tear down |
| 51 | + |
| 52 | +To tear down your Coder deployment, run: |
| 53 | + |
| 54 | +```console |
| 55 | +terragrunt run-all destroy |
| 56 | +``` |
0 commit comments