|
| 1 | +# Copyright Materialize, Inc. and contributors. All rights reserved. |
| 2 | +# |
| 3 | +# Use of this software is governed by the Business Source License |
| 4 | +# included in the LICENSE file at the root of this repository. |
| 5 | +# |
| 6 | +# As of the Change Date specified in that file, in accordance with |
| 7 | +# the Business Source License, use of this software will be governed |
| 8 | +# by the Apache License, Version 2.0. |
| 9 | + |
| 10 | +terraform { |
| 11 | + required_version = ">= 1.0" |
| 12 | + |
| 13 | + required_providers { |
| 14 | + google = { |
| 15 | + source = "hashicorp/google" |
| 16 | + version = ">= 6.0" |
| 17 | + } |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +provider "google" { |
| 22 | + project = var.project_id |
| 23 | + region = var.region |
| 24 | +} |
| 25 | + |
| 26 | +module "materialize" { |
| 27 | + source = "github.com/MaterializeInc/terraform-google-materialize?ref=v0.1.1" |
| 28 | + |
| 29 | + project_id = var.project_id |
| 30 | + region = var.region |
| 31 | + prefix = "tf-gcp-test" |
| 32 | + |
| 33 | + database_config = { |
| 34 | + tier = "db-custom-2-4096" |
| 35 | + version = "POSTGRES_15" |
| 36 | + password = var.database_password |
| 37 | + } |
| 38 | + |
| 39 | + labels = { |
| 40 | + environment = "simple" |
| 41 | + example = "true" |
| 42 | + } |
| 43 | + |
| 44 | + install_materialize_operator = false |
| 45 | +} |
| 46 | + |
| 47 | +variable "project_id" { |
| 48 | + description = "GCP Project ID" |
| 49 | + type = string |
| 50 | + default = "materialize-ci" |
| 51 | +} |
| 52 | + |
| 53 | +variable "region" { |
| 54 | + description = "GCP Region" |
| 55 | + type = string |
| 56 | + default = "us-east1" |
| 57 | +} |
| 58 | + |
| 59 | +variable "database_password" { |
| 60 | + description = "Password for Cloud SQL database user" |
| 61 | + default = "your-strong-password" |
| 62 | + type = string |
| 63 | + sensitive = true |
| 64 | +} |
| 65 | + |
| 66 | +output "gke_cluster" { |
| 67 | + description = "GKE cluster details" |
| 68 | + value = module.materialize.gke_cluster |
| 69 | + sensitive = true |
| 70 | +} |
| 71 | + |
| 72 | +output "service_accounts" { |
| 73 | + description = "Service account details" |
| 74 | + value = module.materialize.service_accounts |
| 75 | +} |
| 76 | + |
| 77 | +output "connection_strings" { |
| 78 | + description = "Connection strings for metadata and persistence backends" |
| 79 | + value = module.materialize.connection_strings |
| 80 | + sensitive = true |
| 81 | +} |
0 commit comments