{"id":13724420,"url":"https://github.com/1ambda/terraform-all-in-one","last_synced_at":"2025-05-12T18:30:53.265Z","repository":{"id":50206161,"uuid":"139292404","full_name":"1ambda/terraform-all-in-one","owner":"1ambda","description":"Get fine-grained Kubernetes + Infrastructure on AWS in 30 mins 🚀","archived":false,"fork":false,"pushed_at":"2022-12-08T02:13:10.000Z","size":88,"stargazers_count":76,"open_issues_count":4,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-01T09:01:35.178Z","etag":null,"topics":["ansible","aws","ecs","kops","kubernetes","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1ambda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-01T01:39:53.000Z","updated_at":"2024-04-27T11:47:36.000Z","dependencies_parsed_at":"2023-01-25T03:15:28.996Z","dependency_job_id":null,"html_url":"https://github.com/1ambda/terraform-all-in-one","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1ambda%2Fterraform-all-in-one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1ambda%2Fterraform-all-in-one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1ambda%2Fterraform-all-in-one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1ambda%2Fterraform-all-in-one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1ambda","download_url":"https://codeload.github.com/1ambda/terraform-all-in-one/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253797914,"owners_count":21965979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ansible","aws","ecs","kops","kubernetes","terraform"],"created_at":"2024-08-03T01:01:56.861Z","updated_at":"2025-05-12T18:30:52.922Z","avatar_url":"https://github.com/1ambda.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# terraform-all-in-one\n\nGet fine-grained Kubernetes + Infrastructure on AWS in 30 mins 🚀\n\n- [Prerequisite](#prerequisite)\n- [Usage](#usage)\n- [Features](#features)\n- [Credits](#credits)\n\n\u003cbr/\u003e\n\n## Prerequisite\n\n- [ansible](https://github.com/ansible/ansible)\n- [jq](https://github.com/stedolan/jq)\n- [terraform](https://github.com/hashicorp/terraform)\n- [kops](https://github.com/kubernetes/kops)\n- [awscli](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)\n\n```bash\n$ brew install ansible jq terraform kops watch\n$ pip install awscli\n\n$ git clone git@github.com:1ambda/terraform-all-in-one.git\n$ cd terraform-all-one\n\n# Remove .gitigonre to index generated files\nrm .gitignore\n```\n\n## Usage\n\n### 1. Export AWS Key Environment variables\n\nThe key should have `AdministratorAccess` permission.\n\n```bash\n$ export AWS_ACCESS_KEY_ID={VALUE} AWS_SECRET_ACCESS_KEY={VALUE}\n```\n\n### 2. Generate SSH Key Pair\n\n```bash\n# Modify values for `COMPANY`,`PROJECT`, and `EMAIL`\n$ COMPANY=github PROJECT=1ambda EMAIL=1ambda@github.com ./create-ssh-key.sh\n```\n\n### 3. Modify Terraform Variables to Customize\n\n- [variable.customize.tf](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/variable.customize.tf)\n- [variable.resource.tf](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/variable.resource.tf)\n\n[company](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/variable.customize.tf#L8) and [project](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/variable.customize.tf#L13) variable should match with values used for the generated ssh key.\n\n### 4. Applying Terraform Modules\n\n- [x] **root-infra**: Create VPC, Bastion, ECS, Stroages and build kops scripts\n    ```bash\n    cd root-infra;\n\n    # build infra using terraform\n    terraform init\n    terraform apply -var 'rds_username={USERNAME}' -var 'rds_password={PASSWORD}'\n\n    # provision non-managed stroages using ansible\n    ../script-provision/generated.provision-zookeeper.sh\n    ```\n\n- [x] **root-kubernetes**: [Build Kubernetes Cluster](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes#1-creating-cluster) and [install add-ons](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes#2-deploying-add-ons)\n    ```bash\n    cd root-kubernetes;\n\n    # generate kops files\n    $(cat generated.kops-env.sh);\n    ./generated.kops-create.sh;\n\n    # build kubernetes cluster\n    terraform init\n    terraform apply\n\n    # wait for few minitues until Kube API ELB is ready (`api-kops-*`)\n    # then validate the created cluster\n    kops export kubecfg --name=$NAME\n    ./generated.correct-kubectl-context.sh\n\n    # wait for 3-5 mins until kubernetes cluster is ready\n    kops validate cluster\n    kubectl get pods\n    ```\n\n## Features\n\n- [VPC](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-vpc/vpc.tf)\n- [Basiton Host](https://github.com/1ambda/terraform-all-in-one/tree/master/root-infra/module-bastion)\n    * [Install Storage Clients (e.g mysql, redis, ..) using user-data](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-bastion/bastion-lc.tf#L1-L18)\n    * [Configurable SSH Whitelist](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-bastion/security-group.bastion.tf#L28-L42)\n    * [SSH Connection](https://github.com/1ambda/terraform-all-in-one/blob/master/script-ssh/generated.ssh-bastion.sh), [Proxy Utilities](https://github.com/1ambda/terraform-all-in-one/blob/master/script-ssh/generated.ssh-proxy-zookeeper-01.sh)\n- [ECS](https://github.com/1ambda/terraform-all-in-one/tree/master/root-infra/module-ecs)\n    * [ASG Scaling Policies](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-ecs/ecs-asg-scaling-policy.tf)\n    * [Cloudwatch Log Groups for ECS AWSLOGS](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-ecs/ecs-awslogs.tf)\n    * [Cloudwatch Custom Metrics + Alerts for ECS: Logical Volume](https://github.com/1ambda/terraform-all-in-one/blob/master/template/template.install-cloudwatch-custom-metric-agent-ecs.sh)\n    * [Customized Container Volume Size (--storage-opt dm.basesize)](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-ecs/ecs-lc.tf#L75-L80)\n    * [Report Inactive ECS Host Machine to Slack via Lambda + ECS Event](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-ecs/ecs-monitoring-event-instance-availability.tf)\n    * [Dynamic Cloudwatch Alarm Registration for ASG Event](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-messaging/sns-lambda-asg-event.tf)\n- [Managed Storages: RDS (MariaDB), Elasticsearch, Elasticache (Redis)](https://github.com/1ambda/terraform-all-in-one/tree/master/root-infra/module-storage-managed)\n    * [Cloudwatch Default Metrics + Alerts](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-managed/storage-ec-cloudwatch-alarm.tf)\n    * [Cloudwatch Log Groups for RDS: Audit, Slow Index, Error, General](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-managed/storage-rds.tf#L167-L172)\n    * [Cloudwatch Log Groups for ES: Slow Query, Slow Index](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-managed/storage-es.tf#L68-L78)\n    * [Configurable Clustering](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/variable.resource.tf#L13-L27)\n    * [RDS option group for utf8mb4](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-managed/storage-rds.tf#L49-L92) :see_no_evil:\n- [Barematal Storages: Zookeeper](https://github.com/1ambda/terraform-all-in-one/tree/master/root-infra/module-storage-managed)\n    * [Ansible Provisioning](https://github.com/1ambda/terraform-all-in-one/tree/master/script-provision)\n    * [Cloudwatch Log Groups for ZK AWSLOGS](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-baremetal/storage-zookeeper-awslogs.tf)\n    * [Cloudwatch Custom Metrics](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-baremetal/storage-zookeeper.tf#L49-L73) + [Alerts for EC2: Memory, Disk Space](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-baremetal/storage-zookeeper-cloudwatch-alarm.tf)\n    * [ELB-backed Health Check (Cloudwatch Alarm ](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-storage-baremetal/storage-zookeeper.tf#L123-L153)\n- [Kubernetes Cluster (Single Master)](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes)\n    * [Terraform Intergrated Kubernetes Cluster Creation using kops](https://github.com/1ambda/terraform-all-in-one/tree/master/root-infra/module-kops)\n    * [Cloudwatch Log Groups for Kube AWSLOGS](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-kops/kops-awslogs.tf)\n    * [Dynamic Cloudwatch Alarm Registration for ASG Event](https://github.com/1ambda/terraform-all-in-one/blob/master/root-kubernetes/kubernetes-monitoring-cloudwatch-alarm.tf#L133-L146)\n    * [Cloudwatch Custom Metrics](https://github.com/1ambda/terraform-all-in-one/blob/master/root-infra/module-kops/template.kops-manifest.yaml#L80-L94) + [Alerts for EC2: Memory, Disk Space](https://github.com/1ambda/terraform-all-in-one/blob/master/root-kubernetes/kubernetes-monitoring-cloudwatch-alarm.tf)\n    * [add-on: Nginx Ingerss Chart with AWS ACM](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes#21-acm--nginx-ingress)\n    * [add-on: Kubernetes Dashboard](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes#21-acm--nginx-ingress)\n    * [add-on: Elasticsearch, Kibana, Fluentd](https://github.com/1ambda/terraform-all-in-one/tree/master/root-kubernetes#23-ekf--es-curator)\n\n## Credits\n\n- [terraform-aws-vpc](https://github.com/terraform-aws-modules/terraform-aws-vpc)\n- [terraform-sns-slack](https://github.com/builtinnya/aws-sns-slack-terraform)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1ambda%2Fterraform-all-in-one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1ambda%2Fterraform-all-in-one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1ambda%2Fterraform-all-in-one/lists"}