coder/examples/templates/gcp-devcontainer
Muhammad Atif Ali 5b071f4d94
feat(examples/templates): add GCP VM devcontainer template (#11246)
2023-12-21 13:01:10 +00:00
..
README.md feat(examples/templates): add GCP VM devcontainer template (#11246) 2023-12-21 13:01:10 +00:00
architecture.svg feat(examples/templates): add GCP VM devcontainer template (#11246) 2023-12-21 13:01:10 +00:00
main.tf feat(examples/templates): add GCP VM devcontainer template (#11246) 2023-12-21 13:01:10 +00:00

README.md

display_name description icon maintainer_github verified tags
Google Compute Engine (Devcontainer) Provision a Devcontainer on Google Compute Engine instances as Coder workspaces ../../../site/static/icon/gcp.png coder true
vm
linux
gcp
devcontainer

Remote Development in a Devcontainer on Google Compute Engine

Architecture Diagram

Prerequisites

Authentication

This template assumes that coderd is run in an environment that is authenticated with Google Cloud. For example, run gcloud auth application-default login to import credentials on the system and user running coderd. For other ways to authenticate consult the Terraform docs.

Coder requires a Google Cloud Service Account to provision workspaces. To create a service account:

  1. Navigate to the CGP console, and select your Cloud project (if you have more than one project associated with your account)

  2. Provide a service account name (this name is used to generate the service account ID)

  3. Click Create and continue, and choose the following IAM roles to grant to the service account:

    • Compute Admin
    • Service Account User

    Click Continue.

  4. Click on the created key, and navigate to the Keys tab.

  5. Click Add key > Create new key.

  6. Generate a JSON private key, which will be what you provide to Coder during the setup process.

Architecture

This template provisions the following resources:

  • GCP VM (persistent)
  • GCP Disk (persistent, mounted to root)

Coder persists the root volume. The full filesystem is preserved when the workspace restarts.

Note This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.

code-server

code-server is installed via the code-server registry module. Please check Coder Registry for a list of all modules and templates.