{"id":19663823,"url":"https://github.com/bn-digital/terraform","last_synced_at":"2025-08-26T11:36:25.354Z","repository":{"id":51275580,"uuid":"397400938","full_name":"bn-digital/terraform","owner":"bn-digital","description":"Provision and manage infrastructure with Terraform including Kubernetes cluster, Nginx Ingress controller with SSL, and S3 CDN.","archived":false,"fork":false,"pushed_at":"2024-02-29T20:20:39.000Z","size":39,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"latest","last_synced_at":"2025-01-10T02:17:20.114Z","etag":null,"topics":["devops","digitalocean","iac","terraform"],"latest_commit_sha":null,"homepage":"","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/bn-digital.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}},"created_at":"2021-08-17T21:58:46.000Z","updated_at":"2022-05-29T15:50:35.000Z","dependencies_parsed_at":"2024-02-29T21:44:12.145Z","dependency_job_id":null,"html_url":"https://github.com/bn-digital/terraform","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/bn-digital%2Fterraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bn-digital%2Fterraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bn-digital%2Fterraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bn-digital%2Fterraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bn-digital","download_url":"https://codeload.github.com/bn-digital/terraform/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240974120,"owners_count":19887258,"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":["devops","digitalocean","iac","terraform"],"created_at":"2024-11-11T16:15:47.615Z","updated_at":"2025-02-27T03:41:23.936Z","avatar_url":"https://github.com/bn-digital.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Modules\n\n## DigitalOcean\n\nProvision DigitalOcean account, creating next resources:\n\n- _Project_\n- _Domain_\n- _VPC_\n- _Kubernetes Cluster_\n- _Node Pool_ with autoscaling (1-2 _Droplets_ 2vCPU \u0026 4Gb RAM)\n- _Spaces Bucket_\n\n### CI/CD Pipeline\n\n#### Github Action\n\n##### .github/workflows/continuous-delivery.yml\n\n```yaml\n\nname: Continuous Delivery\non:\n  push:\n    tags:\n      - '*'\n\njobs:\n  provision:\n    uses: bn-digital/terraform/.github/workflows/provision-infrastructure.yml@latest\n    secrets: inherit\n    env:\n      DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}\n      SPACES_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}\n      SPACES_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}\n    with:\n      domain: example.com # Could be stored as Github Secret - use then ${{ secrets.DOMAIN }}\n      provider: digitalocean\n      environment: production\n```\n\n### Example\n\n#### Environment Variables\n\n- `DIGITALOCEAN_TOKEN`\n- `SPACES_ACCESS_KEY_ID`\n- `SPACES_SECRET_ACCESS_KEY`\n\n#### Infrastructure as a Code\n\n##### variables.tf\n\n```terraform\n\nlocals {\n  app_name = basename(dirname(\"${path.cwd}/../../\"))\n  domain = var.domain == \"\" ? \"${local.app_name}.bndigital.ai\" : var.domain \n}\n\nvariable \"domain\" {\n  type = string\n  default = \"\"\n}\n\nvariable \"environment\" {\n  type = string\n  default = \"production\"\n}\n\n```\n##### terraform.tf\n\n\u003e Ensure key contains proper app-name!\n\n```terraform\nterraform {\n  backend \"s3\" {\n    endpoint                    = \"fra1.digitaloceanspaces.com\"\n    key                         = \"terraform/%app-name%/terraform.tfstate\"\n    bucket                      = \"bn-digital\"\n    region                      = \"us-east-1\"\n    skip_credentials_validation = true\n    skip_metadata_api_check     = true\n  }\n}\n\nprovider \"digitalocean\" { }\n```\n\n##### main.tf\n```terraform\n\nmodule \"digitalocean\" {\n  source = \"github.com/bn-digital/terraform//digitalocean\"\n\n  project =  local.project\n  environment = var.environment\n  domain = var.domain\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbn-digital%2Fterraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbn-digital%2Fterraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbn-digital%2Fterraform/lists"}