This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables | |
variable project {} | |
variable region {} | |
variable zone {} | |
variable billing_id {} | |
variable org_id {} | |
variable k8s_username {} | |
variable k8s_password {} | |
variable metabase_db_user {} | |
variable metabase_db_password {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables | |
variable project {} | |
variable region {} | |
variable zone {} | |
variable billing_id {} | |
variable org_id {} | |
variable k8s_username {} | |
variable k8s_password {} | |
variable metabase_db_user {} | |
variable metabase_db_password {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "google" { | |
project = "${var.project}" | |
zone = "${var.zone}" | |
} | |
resource "google_project" "demo_project" { | |
name = "${var.project}" | |
project_id = "${var.project}-id" | |
org_id = "${var.org_id}" | |
billing_account = "${var.billing_id}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "project_id" { | |
value = "${google_project.demo_project.project_id}" | |
} | |
output "cloudsql_proxy_sa_key" { | |
value = "${google_service_account_key.cloudsql_proxy_sa_key.private_key}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "google_sql_database_instance" "demo_instance" { | |
project = "${var.project_id}" | |
name = "demo-db" | |
region = "${var.region}" | |
database_version = "POSTGRES_9_6" | |
settings { | |
tier = "db-f1-micro" | |
disk_autoresize = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable project_id {} | |
variable region {} | |
variable metabase_db_user {} | |
variable metabase_db_password {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "metabase_db_name" { | |
value = "${google_sql_database.metabase_database.name}" | |
} | |
output "db_instance_connection_name" { | |
value = "${google_sql_database_instance.demo_instance.connection_name}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable project_id {} | |
variable cloudsql_proxy_sa_key {} | |
variable zone {} | |
variable k8s_username {} | |
variable k8s_password {} | |
variable db_instance_connection_name {} | |
variable metabase_db_name {} | |
variable metabase_db_user {} | |
variable metabase_db_password {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "google_container_cluster" "primary" { | |
project = "${var.project_id}" | |
name = "demo-cluster" | |
location = "${var.zone}" | |
remove_default_node_pool = true | |
initial_node_count = 1 | |
master_auth { | |
username = "${var.k8s_username}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kubernetes_deployment" "metabase" { | |
metadata { | |
name = "metabase" | |
labels = { | |
app = "metabase" | |
} | |
namespace = "${kubernetes_namespace.sandbox.metadata.0.name}" | |
} | |
spec { | |
replicas = 1 |
NewerOlder