Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,35 @@ node_modules
launch.json

# Env files
.env
.env

# Local .terraform directories
**/.terraform/

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Exclude all .tfvars files, which are likely to contain sensitive data
*.tfvars
*.tfvars.json

# Override .tf files if they are used to override resources locally
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore Terraform CLI configuration files
.terraformrc
terraform.rc

# Terraform lock file
.terraform.lock.hcl

# TFLint configuration (if used)
.tflint.hcl
.tflint.yaml
14 changes: 14 additions & 0 deletions backend/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
if [ "$1" == "dev" ]; then
ENV="dev"
elif [ "$1" == "prod" ]; then
ENV="prod"
elif [ "$1" == "sandbox" ]; then
ENV="sandbox"
else
echo "Invalid environment: $1"
exit 1
fi

docker buildx build --platform linux/amd64 -t europe-west1-docker.pkg.dev/driplet-core-$ENV/driplet-repository/driplet:latest .
docker push europe-west1-docker.pkg.dev/driplet-core-$ENV/driplet-repository/driplet:latest
6 changes: 6 additions & 0 deletions infrastructure/env/sandbox/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
terraform {
backend "gcs" {
bucket = "driplet-core-sandbox-tf"
prefix = "driplet/core/sandbox"
}
}
30 changes: 30 additions & 0 deletions infrastructure/env/sandbox/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module "driplet_core" {
source = "../../module"
project_id = var.project_id
region = var.region

# BigQuery Variables
dataset_id = var.dataset_id
table_id = var.table_id
deletion_protection = var.deletion_protection
schema = var.schema
labels = var.labels

# Pub/Sub Variables
topic_name_client_events = var.topic_name_client_events
subscription_name = var.subscription_name

# Networking Variables
domain = var.domain
subnetwork_cidr_range = var.subnetwork_cidr_range
cloud_run_service_name = var.cloud_run_service_name

# Compute / Cloud Run Variables
driplet_image = var.driplet_image
driplet_scheduler_image = var.driplet_scheduler_image
database_user = var.database_user
oauth_run_callback_url = var.oauth_run_callback_url

# Environment name (used for resource naming and labels)
env = var.env
}
92 changes: 92 additions & 0 deletions infrastructure/env/sandbox/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
variable "project_id" {
description = "The GCP project ID for the sandbox environment"
type = string
}

variable "region" {
description = "The GCP region for the sandbox environment"
type = string
}

# BigQuery Variables
variable "dataset_id" {
description = "BigQuery dataset ID"
type = string
}

variable "table_id" {
description = "BigQuery table ID"
type = string
}

variable "deletion_protection" {
description = "Enable deletion protection for the BigQuery table"
type = bool
default = false
}

variable "schema" {
description = "The JSON schema for the BigQuery table"
type = string
}

variable "labels" {
description = "Optional labels for the BigQuery dataset"
type = map(string)
default = {}
}

# Pub/Sub Variables
variable "topic_name_client_events" {
description = "Name of the Pub/Sub topic for client events"
type = string
}

variable "subscription_name" {
description = "Name of the Pub/Sub subscription"
type = string
}

# Networking Variables
variable "domain" {
description = "The domain name for the SSL certificate"
type = string
}

variable "subnetwork_cidr_range" {
description = "The CIDR range for the subnetwork"
type = string
}

variable "cloud_run_service_name" {
description = "The Cloud Run service name for the network endpoint group"
type = string
}

# Compute / Cloud Run Variables
variable "driplet_image" {
description = "Container image for the Cloud Run service"
type = string
}

variable "driplet_scheduler_image" {
description = "Container image for the Cloud Run service"
type = string
}

variable "database_user" {
description = "Database username for connecting to Cloud SQL"
type = string
}

variable "oauth_run_callback_url" {
description = "OAuth callback URL for Cloud Run"
type = string
}

# New variable for environment name
variable "env" {
description = "Environment name (e.g., 'sandbox', 'dev', 'prod')"
type = string
default = ""
}
Loading