google_looker_instance

A Google Cloud Looker instance.

To get more information about Instance, see:

Open in Cloud Shell

Example Usage - Looker Instance Basic

resource "google_looker_instance" "looker-instance" {
  name              = "my-instance"
  platform_edition  = "LOOKER_CORE_STANDARD_ANNUAL"
  region            = "us-central1"
  oauth_config {
    client_id = "my-client-id"
    client_secret = "my-client-secret"
  }
}
Open in Cloud Shell

Example Usage - Looker Instance Full

resource "google_looker_instance" "looker-instance" {
  name               = "my-instance"
  platform_edition   = "LOOKER_CORE_STANDARD_ANNUAL"
  region             = "us-central1"
  public_ip_enabled  = true
  admin_settings {
    allowed_email_domains = ["google.com"]
  }
  maintenance_window {
    day_of_week = "THURSDAY"
    start_time {
      hours   = 22
      minutes = 0
      seconds = 0
      nanos   = 0
    }
  }
  deny_maintenance_period {    
    start_date {
      year = 2050
      month = 1
      day = 1
    }
    end_date {
      year = 2050
      month = 2
      day = 1
    }
    time {
      hours = 10
      minutes = 0
      seconds = 0
      nanos = 0
    }
  }
  oauth_config {
    client_id = "my-client-id"
    client_secret = "my-client-secret"
  }  
}
## Example Usage - Looker Instance Enterprise Full
resource "google_looker_instance" "looker-instance" {
  name               = "my-instance"
  platform_edition   = "LOOKER_CORE_ENTERPRISE_ANNUAL"
  region             = "us-central1"
  private_ip_enabled = true
  public_ip_enabled  = false
  reserved_range     = "${google_compute_global_address.looker_range.name}"
  consumer_network   = google_compute_network.looker_network.id
  admin_settings {
    allowed_email_domains = ["google.com"]
  }
  encryption_config {
    kms_key_name = "looker-kms-key"
  }
  maintenance_window {
    day_of_week = "THURSDAY"
    start_time {
      hours   = 22
      minutes = 0
      seconds = 0
      nanos   = 0
    }
  }
  deny_maintenance_period {
    start_date {
      year = 2050
      month = 1
      day = 1
    }
    end_date {
      year = 2050
      month = 2
      day = 1
    }
    time {
      hours = 10
      minutes = 0
      seconds = 0
      nanos = 0
    }
  }
  oauth_config {
    client_id = "my-client-id"
    client_secret = "my-client-secret"
  }
  depends_on   = [
    google_service_networking_connection.looker_vpc_connection
  ]
}

resource "google_service_networking_connection" "looker_vpc_connection" {
  network                 = google_compute_network.looker_network.id
  service                 = "servicenetworking.googleapis.com"
  reserved_peering_ranges = [google_compute_global_address.looker_range.name]
}

resource "google_compute_global_address" "looker_range" {
  name          = "looker-range"
  purpose       = "VPC_PEERING"
  address_type  = "INTERNAL"
  prefix_length = 20
  network       = google_compute_network.looker_network.id
}

data "google_project" "project" {}

resource "google_compute_network" "looker_network" {
  name = "looker-network"
}

resource "google_kms_crypto_key_iam_member" "crypto_key" {
  crypto_key_id = "looker-kms-key"
  role          = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
  member        = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-looker.iam.gserviceaccount.com"
}
Open in Cloud Shell

Example Usage - Looker Instance Custom Domain

resource "google_looker_instance" "looker-instance" {
  name              = "my-instance"
  platform_edition  = "LOOKER_CORE_STANDARD_ANNUAL"
  region            = "us-central1"
  oauth_config {
    client_id = "my-client-id"
    client_secret = "my-client-secret"
  }
  // After your Looker (Google Cloud core) instance has been created, you can set up, view information about, or delete a custom domain for your instance. 
  // Therefore 2 terraform applies, one to create the instance, then another to set up the custom domain. 
  custom_domain {
    domain = "my-custom-domain.com"
  }
}

Argument Reference

The following arguments are supported:


The admin_settings block supports:

The deny_maintenance_period block supports:

The start_date block supports:

The end_date block supports:

The time block supports:

The encryption_config block supports:

The maintenance_window block supports:

The start_time block supports:

The oauth_config block supports:

The user_metadata block supports:

The custom_domain block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Instance can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Instance using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{region}}/instances/{{name}}"
  to = google_looker_instance.default
}

When using the terraform import command, Instance can be imported using one of the formats above. For example:

$ terraform import google_looker_instance.default projects/{{project}}/locations/{{region}}/instances/{{name}}
$ terraform import google_looker_instance.default {{project}}/{{region}}/{{name}}
$ terraform import google_looker_instance.default {{region}}/{{name}}
$ terraform import google_looker_instance.default {{name}}

User Project Overrides

This resource supports User Project Overrides.