Skip to content
Snippets Groups Projects
init.tf 2.52 KiB
Newer Older
  # allow the lowest common version across all projects, so that the current CI docker image version suits all projects
  required_version = ">= 1.9"
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "6.24.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "6.24.0"
  backend "gcs" {
    bucket = "holi-shared-terraform-state"
    prefix = "unified-api-environments"
  }
}

data "terraform_remote_state" "holi_infra_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "infra"
  }
}

data "terraform_remote_state" "holi_unified_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "unified-api-common"
  }
}

Ole Langbehn's avatar
Ole Langbehn committed
data "terraform_remote_state" "holi_okuna_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "okuna-common"
  }
}

data "terraform_remote_state" "holi_donations_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "donations-api-common"
  }
}

data "terraform_remote_state" "holi_goodnews_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "goodnews-api-common"
  }
}

data "terraform_remote_state" "holi_geo_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "geo-api-common"
  }
}

data "terraform_remote_state" "holi_volunteering_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "volunteering-api-common"
  }
}

data "terraform_remote_state" "holi_notifications_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "notifications-api-common"
  }
}

data "terraform_remote_state" "holi_translation_api_common_state" {
  backend = "gcs"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "translation-api-common"
  }
}

data "terraform_remote_state" "holi_moderation_environment_state" {
  # provide staging moderation environment state for all review deployments of unified-api
  workspace = local.environment == "production" ? "production" : "staging"
  config = {
    bucket = "holi-shared-terraform-state"
    prefix = "moderation-environments"
  }
}

# provider google including beta features
provider "google" {
  region = local.default_region
  region = local.default_region