57dc91585d
Internal SmartGift build of a Claude Code monitoring dashboard. Lanes: a durable unit of parallel agent work, one per working directory, tracked across session restarts. Managed lanes are git worktrees the dashboard provisions and can reset or remove behind a three-check destroy guard and a counted preflight; adopted lanes are directories you already own and are never destroyable. Pipelines: a lane moves through pipeline stages. A stage the agent declares with evidence renders green; a stage inferred from the tool-event stream renders dashed amber and never counts as done. Detection is forward-only within a 30-minute window, and never writes the declared stage. Workspace: one page at /run with a lane grid, the selected lane's pipeline, and a full Claude console behind a disclosure.
202 lines
6.2 KiB
Terraform
202 lines
6.2 KiB
Terraform
# ─────────────────────────────────────────────────────────────────────────────
|
|
# GCP provider variables
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
variable "project_name" {
|
|
description = "Project identifier used in resource naming"
|
|
type = string
|
|
default = "claude-agent-monitor"
|
|
}
|
|
|
|
variable "environment" {
|
|
description = "Deployment environment: dev, staging, or production"
|
|
type = string
|
|
validation {
|
|
condition = contains(["dev", "staging", "production"], var.environment)
|
|
error_message = "environment must be one of: dev, staging, production."
|
|
}
|
|
}
|
|
|
|
variable "gcp_project_id" {
|
|
description = "GCP project ID for resource deployment"
|
|
type = string
|
|
}
|
|
|
|
variable "region" {
|
|
description = "GCP region for resource deployment"
|
|
type = string
|
|
default = "us-central1"
|
|
}
|
|
|
|
variable "tags" {
|
|
description = "Additional labels to apply to all resources"
|
|
type = map(string)
|
|
default = {}
|
|
}
|
|
|
|
# ── Networking ──────────────────────────────────────────────────────────────
|
|
|
|
variable "vpc_cidr" {
|
|
description = "CIDR block for the VPC (used for firewall rules)"
|
|
type = string
|
|
default = "10.0.0.0/16"
|
|
}
|
|
|
|
variable "private_subnet_cidrs" {
|
|
description = "CIDR blocks for private subnets"
|
|
type = list(string)
|
|
default = ["10.0.11.0/24"]
|
|
}
|
|
|
|
# ── Compute ─────────────────────────────────────────────────────────────────
|
|
|
|
variable "app_container_image" {
|
|
description = "Container image URI for the main application"
|
|
type = string
|
|
}
|
|
|
|
variable "mcp_container_image" {
|
|
description = "Container image URI for the MCP sidecar (empty to disable)"
|
|
type = string
|
|
default = ""
|
|
}
|
|
|
|
variable "app_port" {
|
|
description = "Application container port"
|
|
type = number
|
|
default = 4820
|
|
}
|
|
|
|
variable "mcp_port" {
|
|
description = "MCP sidecar container port"
|
|
type = number
|
|
default = 8819
|
|
}
|
|
|
|
variable "cpu" {
|
|
description = "CPU millicores for each Cloud Run instance"
|
|
type = number
|
|
default = 512
|
|
}
|
|
|
|
variable "memory" {
|
|
description = "Memory in MiB for each Cloud Run instance"
|
|
type = number
|
|
default = 1024
|
|
}
|
|
|
|
variable "min_replicas" {
|
|
description = "Minimum number of Cloud Run instances"
|
|
type = number
|
|
default = 0
|
|
}
|
|
|
|
variable "max_replicas" {
|
|
description = "Maximum number of Cloud Run instances"
|
|
type = number
|
|
default = 3
|
|
}
|
|
|
|
variable "environment_variables" {
|
|
description = "Environment variables for the application container"
|
|
type = map(string)
|
|
default = {
|
|
NODE_ENV = "production"
|
|
DASHBOARD_PORT = "4820"
|
|
}
|
|
}
|
|
|
|
# ── Deployment ──────────────────────────────────────────────────────────────
|
|
|
|
variable "active_deployment_slot" {
|
|
description = "Active deployment slot: blue or green"
|
|
type = string
|
|
default = "blue"
|
|
validation {
|
|
condition = contains(["blue", "green"], var.active_deployment_slot)
|
|
error_message = "active_deployment_slot must be blue or green."
|
|
}
|
|
}
|
|
|
|
variable "blue_weight" {
|
|
description = "Traffic weight for blue service (0-100)"
|
|
type = number
|
|
default = 100
|
|
validation {
|
|
condition = var.blue_weight >= 0 && var.blue_weight <= 100
|
|
error_message = "blue_weight must be between 0 and 100."
|
|
}
|
|
}
|
|
|
|
variable "green_weight" {
|
|
description = "Traffic weight for green service (0-100)"
|
|
type = number
|
|
default = 0
|
|
validation {
|
|
condition = var.green_weight >= 0 && var.green_weight <= 100
|
|
error_message = "green_weight must be between 0 and 100."
|
|
}
|
|
}
|
|
|
|
# ── TLS / Domain ────────────────────────────────────────────────────────────
|
|
|
|
variable "domain_name" {
|
|
description = "FQDN for managed SSL certificate (empty for HTTP only)"
|
|
type = string
|
|
default = ""
|
|
}
|
|
|
|
# ── Storage ─────────────────────────────────────────────────────────────────
|
|
|
|
variable "storage_size_gb" {
|
|
description = "Filestore capacity in GiB"
|
|
type = number
|
|
default = 1024 # Filestore minimum for BASIC_HDD
|
|
}
|
|
|
|
# ── Health check ────────────────────────────────────────────────────────────
|
|
|
|
variable "health_check_path" {
|
|
description = "HTTP path for health checks"
|
|
type = string
|
|
default = "/api/health"
|
|
}
|
|
|
|
variable "health_check_interval" {
|
|
description = "Seconds between health checks"
|
|
type = number
|
|
default = 30
|
|
}
|
|
|
|
variable "health_check_timeout" {
|
|
description = "Seconds before a health check times out"
|
|
type = number
|
|
default = 5
|
|
}
|
|
|
|
variable "health_check_healthy_threshold" {
|
|
description = "Consecutive successes to mark healthy"
|
|
type = number
|
|
default = 2
|
|
}
|
|
|
|
variable "health_check_unhealthy_threshold" {
|
|
description = "Consecutive failures to mark unhealthy"
|
|
type = number
|
|
default = 3
|
|
}
|
|
|
|
# ── Monitoring ──────────────────────────────────────────────────────────────
|
|
|
|
variable "enable_monitoring" {
|
|
description = "Enable Cloud Monitoring alerts and dashboard"
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "alert_email" {
|
|
description = "Email for monitoring notifications"
|
|
type = string
|
|
default = ""
|
|
}
|