{"id":37320111,"url":"https://github.com/csiro/cdk-monitoring-stack","last_synced_at":"2026-01-16T03:17:07.826Z","repository":{"id":309853323,"uuid":"1037096104","full_name":"csiro/cdk-monitoring-stack","owner":"csiro","description":"Providing an easy to deploy, AWS, open-source basic application monitoring stack (uptime-kuma and bugsink)","archived":false,"fork":false,"pushed_at":"2025-08-14T05:07:40.000Z","size":61,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T06:42:08.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-13T04:11:50.000Z","updated_at":"2025-08-14T23:06:05.000Z","dependencies_parsed_at":"2025-08-14T07:08:41.824Z","dependency_job_id":"4ef8f3f9-36bd-46ef-a32a-e7a8fe4c1e3a","html_url":"https://github.com/csiro/cdk-monitoring-stack","commit_stats":null,"previous_names":["csiro/cdk-monitoring-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/csiro/cdk-monitoring-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fcdk-monitoring-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fcdk-monitoring-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fcdk-monitoring-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fcdk-monitoring-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csiro","download_url":"https://codeload.github.com/csiro/cdk-monitoring-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csiro%2Fcdk-monitoring-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T03:17:07.281Z","updated_at":"2026-01-16T03:17:07.818Z","avatar_url":"https://github.com/csiro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monitoring Stack AWS CDK\n\nThe below provides a developer oriented README - for a quickstart/tutorial to deploy the monitoring stack, see [setup](./SETUP.md).\n\nThis CDK project deploys an open-source monitoring solution on AWS EC2 that includes both [Bugsink](https://github.com/bugsink/bugsink) (error tracking) and [Uptime Kuma](https://github.com/louislam/uptime-kuma) (uptime monitoring) with automatic DNS configuration and SSL certificates using Docker Compose and Caddy reverse proxy.\n\n## Prerequisites\n\n- AWS CLI configured with appropriate credentials\n- Node.js and npm installed\n- AWS CDK CLI installed (`npm install -g aws-cdk`)\n- A Route 53 hosted zone for your domain\n\n## Quickstart\n\nThe below is a summary of more detailed setup instructions provided in [setup](./SETUP.md).\n\n1. **Clone the repository and install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n2. **Configure environment variables:**\n\n   ```bash\n   cp .env.dist .env\n   ```\n\n3. **Edit the `.env` file with your configuration:**\n\n   ```bash\n   # Stack name for CloudFormation\n   CDK_STACK_NAME=monitoring-stack\n\n   # Your Route 53 hosted zone ID (found in AWS Console \u003e Route 53 \u003e Hosted zones)\n   CDK_HOSTED_ZONE_ID=Z1234567890ABC\n\n   # The domain name for your hosted zone (e.g., example.com)\n   CDK_HOSTED_ZONE_DOMAIN_NAME=example.com\n\n   # The subdomain where Bugsink will be accessible (e.g., bugsink)\n   # This will create bugsink.example.com\n   CDK_BUGSINK_SUBDOMAIN=bugsink\n\n   # The subdomain where Uptime Kuma will be accessible (e.g., uptime)\n   # This will create uptime.example.com\n   CDK_UPTIME_SUBDOMAIN=uptime\n   ```\n\n## Deployment\n\n1. **Bootstrap CDK (first time only):**\n\n   ```bash\n   npx cdk bootstrap\n   ```\n\n2. **Deploy the stack:**\n\n   ```bash\n   npx cdk deploy\n   ```\n\n3. **Access your monitoring services:**\n\n   After deployment, your services will be available at:\n\n   - **Bugsink (Error Tracking)**: `https://{CDK_BUGSINK_SUBDOMAIN}.{CDK_HOSTED_ZONE_DOMAIN_NAME}`\n   - **Uptime Kuma (Uptime Monitoring)**: `https://{CDK_UPTIME_SUBDOMAIN}.{CDK_HOSTED_ZONE_DOMAIN_NAME}`\n\n   Login credentials for Bugsink are automatically generated and stored in AWS Secrets Manager.\n\n## What Gets Deployed\n\n- **VPC**: A new VPC with public subnet (single AZ for cost optimization)\n- **EC2 Instance**: An EC2 instance (t3.small by default) running both monitoring services\n- **Elastic IP**: A static IP address for the instance\n- **Route 53 Records**: DNS A records for both subdomains pointing to your instance\n- **Security Groups**: Firewall rules allowing HTTP (80) and HTTPS (443) access\n- **AWS Secrets Manager**: Secure storage for database passwords and API keys\n- **Docker Services**:\n  - **Bugsink**: Error tracking and monitoring application\n  - **Uptime Kuma**: Uptime monitoring dashboard\n  - **MySQL**: Database for Bugsink\n  - **Caddy**: Reverse proxy with automatic SSL certificate management\n\n## Architecture\n\nThe deployed solution uses Docker Compose to coordinate multiple services:\n\n- **Caddy** acts as a reverse proxy, automatically obtaining SSL certificates from Let's Encrypt\n- **Bugsink** provides error tracking capabilities with Django backend\n- **Uptime Kuma** offers uptime monitoring with a web-based dashboard\n- **MySQL** serves as the database for Bugsink\n- All services run on a single EC2 instance with persistent data storage\n\n## Configuration\n\n- Default instance: `t3.small` (can be customized)\n- Default storage: 80GB EBS volume (can be customized)\n- Automatic SSL certificate generation via Let's Encrypt\n- Persistent data storage for databases and application data\n- Systemd service for automatic startup and management\n\n## Monitoring and Logs\n\nOnce deployed, you can monitor your services:\n\n```bash\n# SSH into the instance (using Session Manager)\naws ssm start-session --target \u003cinstance-id\u003e\n\n# Check service status\ndocker compose ps\n\n# View logs\ndocker compose logs bugsink\ndocker compose logs uptime-kuma\ndocker compose logs caddy\ndocker compose logs mysql\n\n# View installation logs\ntail -f /home/ubuntu/user-data.log\n```\n\n## Cleanup\n\nTo destroy all resources:\n\n```bash\ncdk destroy\n```\n\n**Note**: This will permanently delete all data stored in the monitoring applications. Make sure to backup any important data before destroying the stack.\n\n## Troubleshooting\n\n- Ensure your AWS credentials have the necessary permissions for EC2, VPC, Route 53, Secrets Manager, and CloudFormation\n- Verify that your hosted zone exists and the domain is properly configured\n- Check that the subdomains don't already exist in your hosted zone\n- SSL certificates may take a few minutes to generate after deployment\n- Ensure DNS propagation is complete before accessing the services\n- Check the user-data logs on the instance for deployment issues: `/home/ubuntu/user-data.log`\n\n## Security Considerations\n\n- Database credentials are automatically generated and stored securely in AWS Secrets Manager\n- SSL certificates are automatically managed by Caddy\n- The instance is accessible only via HTTPS (port 443) and HTTP (port 80, for Let's Encrypt challenges)\n- Consider restricting access further by modifying security groups if needed\n\n## Adding SMTP to BugSink and uptime-kuma\n\n### BugSink\n\nFollow the settings at [Bugsink settings](https://www.bugsink.com/docs/settings) in the Email section, including at least:\n\n- EMAIL_HOST\n- EMAIL_HOST_USER\n- EMAIL_HOST_PASSWORD\n\nTo configure these, connect to the instance using AWS Session Manager, then\n\n```\nsudo su - ubuntu\ncd ~\ndocker compose down\nvim docker-compose.yml\n```\n\nadd the above environment variables in the Bugsink service,\n\nthen save the file and\n\n```\ndocker-compose up -d\n```\n\n### uptime-kuma\n\nYou can configure SMTP while the server is running. Simply visit settings -\u003e Notifications -\u003e Setup Notification -\u003e Notification type Email (SMTP) then fill out the form. You can test the connection to validate correct settings.\n\n## Cost Considerations\n\nBased on 2025 Pricing - Sydney region:\n\n**Monthly Operating Costs (USD):**\n\n- **EC2 t3.small instance**: $19.34 ($0.0264/hour × 24 × 30.5 days)\n- **EBS GP3 storage (80GB)**: $7.68 ($0.096 × 80GB)\n- **AWS Secrets Manager**: $0.80 (2 secrets × $0.40 each)\n- **Elastic IP**: Free (when associated with running instance)\n\n**Total Monthly Cost: $27.82 USD (~$42.56 AUD)**\n\n**Annual Cost: $333.84 USD (~$510.78 AUD)**\n\n**Cost Optimization Options:**\n\n- Use **t3.micro** (2GB RAM) for lighter workloads: saves ~$10/month\n- Reduce EBS storage from 80GB to 40GB: saves ~$3.84/month\n- Use **Reserved Instances** (1-year term): saves ~30-40% on EC2 costs\n\n**Cost Breakdown:**\n\n- EC2 compute: 70% of total cost\n- Storage: 28% of total cost\n- Secrets management: 2% of total cost\n\nThis represents a cost-effective solution for organizations needing both error tracking and uptime monitoring, with predictable monthly expenses and multiple optimization paths available.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsiro%2Fcdk-monitoring-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsiro%2Fcdk-monitoring-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsiro%2Fcdk-monitoring-stack/lists"}