Expert in creating Duplocloud Terraform modules following standard patterns. Use when creating terraform modules, tenants, infrastructures, app modules, or working with duplocloud/terraform-duplocloud-components. Knows module.ctx patterns, JIT credentials, workspace references, and GitHub Actions workflows.
Create and manage Terraform modules following Duplocloud patterns using terraform-duplocloud-components.
Portal (Duplocloud instance)
└── Infrastructure (VPC/GKE cluster)
├── Shared Tenant (databases, caches)
├── Operators Tenant (Kubernetes operators)
└── Application Tenants (dev01, stg01, prod01)
Each layer maps to a Terraform module with workspace instances.
Centralized infrastructure repo (e.g., duplocloud-infra, <company>-infra):
<project>-infra/
├── modules/
│ ├── portal/ # Required: Once per Duplocloud
│ ├── infrastructure/ # Required: VPC/cluster
│ ├── shared/ # Required: Databases, caches
│ ├── tenant/ # Required: App environments
│ ├── operators/ # Required: K8s operators
│ ├── devops/ # Optional: CI/CD secrets
│ └── <app>/ # Optional: Centralized apps
├── config/<module>/<workspace>/<module>.tfvars
└── .github/workflows/
App module lives in the application's own repo:
<app-repo>/
├── src/ # Application code
├── terraform/ # Embedded app module
│ ├── main.tf
│ ├── providers.tf
│ ├── variables.tf
│ └── outputs.tf
├── config/<workspace>/<module>.tfvars
└── .github/workflows/
| Indicator | You're in... |
|-----------|-------------|
| modules/portal/, modules/tenant/, modules/shared/ | Infra repo |
| terraform/ dir + app source code | Embedded app module |
| Only one module + app code | Embedded app module |
Use the tf wrapper command instead of raw terraform. It auto-configures backends and discovers tfvars.
tf init -chdir=modules/tenant # Auto-configures backend
tf ctx dev01 # Select/create workspace
tf plan -chdir=modules/tenant # Auto-loads tfvars
tf apply -chdir=modules/tenant
See: references/tf-cli.md for full documentation and equivalent terraform commands.
Every module uses the context module for data lookups, JIT credentials, and workspace references:
module "ctx" {
source = "duplocloud/components/duplocloud//modules/context"
version = "0.0.41"
admin = true
workspaces = {
tenant = {} # Empty = terraform.workspace is tenant name
}
}
locals {
tenant = module.ctx.workspaces.tenant
}
See: references/context-module.md for JIT credentials, workspace references, and advanced patterns.
| Module | Use Case | Key Pattern |
|--------|----------|-------------|
| portal | Once per Duplocloud | tenant = "default" |
| infrastructure | VPC/cluster per env | References portal |
| shared | Databases, caches | enable_host_other_tenants = true |
| devops | Singleton, CI/CD secrets | No infra/parent, default infra |
| tenant | App environments | References shared + infra |
| app | Per-tenant deployments | Workspace = tenant name |
| operators | Kubernetes operators | JIT k8s credentials |
Detailed patterns: See references/<module-type>.md files.
python scripts/init_module.py myapp --type app --cloud aws
python scripts/init_module.py myapp --type app --cloud gcp --path ./
Templates in assets/ directory:
assets/app/ - App module filesassets/tenant/ - Tenant module filesassets/shared/ - Shared module filesassets/workflow/ - GitHub Actions templatesassets/config/ - Tfvars templatesmodules/<name>/ with: main.tf, providers.tf, variables.tf, outputs.tfconfig/<name>/<workspace>/<name>.tfvars.github/workflows/<name>.ymlpython scripts/validate_module.py modules/myapp
python scripts/validate_module.py . --all # Validate all modules
See: references/workflows.md for CI/CD patterns.
Base workflow in assets/workflow/tf-module.yml handles:
config/<module>/<name>/<module>.tfvarsmodules/<name>/tenant = {})For authoritative documentation:
Never pass secrets through variables. Only DUPLO_TOKEN should be needed.
Pattern:
data block, injects into provider| Directory | Contents |
|-----------|----------|
| references/ | <module-type>.md, database.md, helm.md, secrets.md, aws.md, gcp.md |
| assets/ | Templates: app/, tenant/, shared/, workflow/, config/ |
| scripts/ | init_module.py, validate_module.py |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer