TemplatesModules
Back to Modules
GCP Region Icon

GCP Region

By:
Add Google Cloud Platform regions to your Coder template.
README
Variables (10)
Parameters (1)
Source

This module adds Google Cloud Platform regions to your Coder template.

1module "gcp_region" {
2  source  = "registry.coder.com/modules/gcp-region/coder"
3  version = "1.0.12"
4  regions = ["us", "europe"]
5}
6
7resource "google_compute_instance" "example" {
8  zone = module.gcp_region.value
9}

GCP Regions

Examples

Add only GPU zones in the US West 1 region

Note: setting gpu_only = true and using a default region without GPU support, the default will be set to null.

1module "gcp_region" {
2  source   = "registry.coder.com/modules/gcp-region/coder"
3  version  = "1.0.12"
4  default  = ["us-west1-a"]
5  regions  = ["us-west1"]
6  gpu_only = false
7}
8
9resource "google_compute_instance" "example" {
10  zone = module.gcp_region.value
11}

Add all zones in the Europe West region

1module "gcp_region" {
2  source                 = "registry.coder.com/modules/gcp-region/coder"
3  version                = "1.0.12"
4  regions                = ["europe-west"]
5  single_zone_per_region = false
6}
7
8resource "google_compute_instance" "example" {
9  zone = module.gcp_region.value
10}

Add a single zone from each region in US and Europe that has GPUs

1module "gcp_region" {
2  source                 = "registry.coder.com/modules/gcp-region/coder"
3  version                = "1.0.12"
4  regions                = ["us", "europe"]
5  gpu_only               = true
6  single_zone_per_region = true
7}
8
9resource "google_compute_instance" "example" {
10  zone = module.gcp_region.value
11}