{"id":29177825,"url":"https://github.com/synacktraa/clickhouse-on-ec2-using-tf","last_synced_at":"2026-02-04T00:02:19.632Z","repository":{"id":298393660,"uuid":"999835343","full_name":"synacktraa/clickhouse-on-ec2-using-tf","owner":"synacktraa","description":"Deploy clickhouse server on EC2 using Terraform.","archived":false,"fork":false,"pushed_at":"2025-06-10T22:01:46.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-01T18:10:42.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","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/synacktraa.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-06-10T21:32:21.000Z","updated_at":"2025-06-10T22:01:49.000Z","dependencies_parsed_at":"2025-06-10T22:33:36.581Z","dependency_job_id":"acc491d4-ed48-4f35-afee-87c6390445b4","html_url":"https://github.com/synacktraa/clickhouse-on-ec2-using-tf","commit_stats":null,"previous_names":["synacktraa/clickhouse-on-ec2-using-tf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/synacktraa/clickhouse-on-ec2-using-tf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synacktraa%2Fclickhouse-on-ec2-using-tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synacktraa%2Fclickhouse-on-ec2-using-tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synacktraa%2Fclickhouse-on-ec2-using-tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synacktraa%2Fclickhouse-on-ec2-using-tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synacktraa","download_url":"https://codeload.github.com/synacktraa/clickhouse-on-ec2-using-tf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synacktraa%2Fclickhouse-on-ec2-using-tf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29062483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T23:14:54.203Z","status":"ssl_error","status_checked_at":"2026-02-03T23:14:50.873Z","response_time":96,"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":"2025-07-01T18:08:22.967Z","updated_at":"2026-02-04T00:02:19.612Z","avatar_url":"https://github.com/synacktraa.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clickhouse on EC2 using terraform\n\n## Prerequisites\n\n1. **AWS CLI configured** with appropriate credentials\n2. **Terraform installed**\n\n## Deployment Steps\n\n### 1. Initialize Terraform\n\n```bash\ngit clone https://github.com/synacktraa/clickhouse-on-ec2-using-tf.git\ncd clickhouse-on-ec2-using-tf\nterraform init\n```\n\n### 2. Create Keys\n\n```bash\nssh-keygen -t rsa -b 4096 -f ec2-clickhouse\n```\n\n### 3. Apply the Configuration\n\n```bash\nterraform apply\n```\n\n#### Variables\n\n- `instance_type` - Change Instance's type (Default: `t3.small`)\n- `volume_size` - Modify storage size of the device (Default: `20gb`)\n- `allowed_cidr_blocks` - Restrict access to certain IPs (Default: `0.0.0.0/0`)\n\nType `yes` when prompted to confirm the deployment.\n\n### 4. Get Outputs\n\nAfter deployment, get the connection details:\n\n```bash\n# Get public IP and connection info\nterraform output\n\n# Get the generated password of clickhouse server (sensitive output)\nterraform output -raw clickhouse_password\n```\n\n## Accessing the instance\n\n### Via SSH Tunnel\n\n```bash\n$(terraform output -raw ssh_command)\n```\n\n### Clickhouse HTTP Interface (Web/API)\n\n```bash\n# Basic health check\ncurl http://$(terraform output -raw public_ip):8123/ping\n\n# Run a simple query\ncurl -u \"default:$(terraform output -raw clickhouse_password)\" \"http://$(terraform output -raw public_ip):8123/?query=SELECT+version()\"\n```\n\n### Clickhouse Native TCP Client\n\n```bash\nclickhouse-client --host $(terraform output -raw public_ip) --port 9000 --user default --password $(terraform output -raw clickhouse_password)\n```\n\n## Cleanup\n\nTo destroy all resources:\n\n```bash\nterraform destroy\n```\n\nType `yes` when prompted to confirm destruction.\n\n## Troubleshooting\n\n1. Verify security group rules allow your IP\n2. Check if ClickHouse is listening: `netstat -tlnp | grep :8123`\n3. Test from within the instance: `curl localhost:8123/ping`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynacktraa%2Fclickhouse-on-ec2-using-tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynacktraa%2Fclickhouse-on-ec2-using-tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynacktraa%2Fclickhouse-on-ec2-using-tf/lists"}