TwinMind Deploy Integration
Contents
Overview
Deploy TwinMind integrations to production cloud environments with Docker, AWS ECS/Fargate, GCP Cloud Run, Kubernetes, and GitHub Actions deployment pipelines.
Prerequisites
- Completed
twinmind-ci-integrationsetup - Cloud provider account (AWS, GCP, or Azure)
- Docker installed
- Terraform or Pulumi for IaC
Instructions
Step 1: Docker Configuration
Create multi-stage Dockerfile (builder + runner) with non-root user, health check, and production NODE_ENV. Add docker-compose.yml with service replicas, resource limits, Redis, and logging config.
Step 2: AWS Deployment (ECS/Fargate)
Write Terraform for Secrets Manager (API key + webhook secret), ECS cluster with container insights, Fargate task definition with secrets injection, ECS service with deployment circuit breaker, and CPU-based auto-scaling (2-10 instances, target 70%).
Step 3: GCP Deployment (Cloud Run)
Write Terraform for Secret Manager, Cloud Run v2 service with auto-scaling (1-10 instances), startup/liveness probes, service account with secret accessor role.
Step 4: Kubernetes Deployment
Create Deployment (2 replicas, resource limits, readiness/liveness probes, non-root security context), Service (ClusterIP), and HorizontalPodAutoscaler (CPU target 70%, 2-10 replicas).
Step 5: GitHub Actions Deployment
Create deploy workflow: build-and-push to ECR, deploy-staging (wait for stable), deploy-production (manual approval via environment protection).
See detailed implementation for complete Dockerfile, Terraform modules, Kubernetes manifests, and deployment workflow.
Output
- Docker configuration files
- AWS ECS/Fargate Terraform
- GCP Cloud Run Terraform
- Kubernetes manifests
- GitHub Actions deployment workflow
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Image pull failed | Registry auth | Verify credentials |
| Health check failed | Service not ready | Increase start period |
| Scaling not working | Metrics missing | Check monitoring config |
| Secrets not found | IAM permissions | Update service account |
Examples
Basic usage: Apply twinmind deploy integration to a standard project setup with default configuration options.
Advanced scenario: Customize twinmind deploy integration for production environments with multiple constraints and team-specific requirements.
Resources
Next Steps
For webhook handling, see twinmind-webhooks-events.