{"id":19466794,"url":"https://github.com/dena/dify-google-cloud-terraform","last_synced_at":"2025-04-09T07:06:31.109Z","repository":{"id":258065604,"uuid":"862676425","full_name":"DeNA/dify-google-cloud-terraform","owner":"DeNA","description":"Terraform configuration for deploying Dify on Google Cloud with scalability, high availability, and production-level readiness.","archived":false,"fork":false,"pushed_at":"2025-03-28T07:10:20.000Z","size":287,"stargazers_count":104,"open_issues_count":1,"forks_count":23,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T04:08:29.357Z","etag":null,"topics":["ai","dify","generative-ai","google-cloud","infrastructure","llm","llmops","terraform","workflow"],"latest_commit_sha":null,"homepage":"https://github.com/langgenius/dify","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeNA.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}},"created_at":"2024-09-25T02:14:34.000Z","updated_at":"2025-04-02T03:57:27.000Z","dependencies_parsed_at":"2025-02-24T07:20:21.338Z","dependency_job_id":"d5c440eb-2083-45d5-b860-fce2898223d0","html_url":"https://github.com/DeNA/dify-google-cloud-terraform","commit_stats":null,"previous_names":["dena/dify-google-cloud-terraform"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Fdify-google-cloud-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Fdify-google-cloud-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Fdify-google-cloud-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeNA%2Fdify-google-cloud-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeNA","download_url":"https://codeload.github.com/DeNA/dify-google-cloud-terraform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"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":["ai","dify","generative-ai","google-cloud","infrastructure","llm","llmops","terraform","workflow"],"created_at":"2024-11-10T18:30:14.945Z","updated_at":"2025-04-09T07:06:31.103Z","avatar_url":"https://github.com/DeNA.png","language":"HCL","readme":"# Terraform for Dify on Google Cloud\n\n![Google Cloud](https://img.shields.io/badge/Google%20Cloud-4285F4?logo=google-cloud\u0026logoColor=white)\n![Terraform](https://img.shields.io/badge/Terraform-1.9.5-blue.svg)\n\n\n![Dify GCP Architecture](images/dify-google-cloud-architecture.png)\n\n\u003ca href=\"./README_ja.md\"\u003e\u003cimg alt=\"日本語のREADME\" src=\"https://img.shields.io/badge/日本語-d9d9d9\"\u003e\u003c/a\u003e\n\n\u003e [!NOTE]\n\u003e - Dify v1.0.0 (and later) is supported now! Try it and give us feedbacks!!\n\u003e - If you fail to install any plugin, try several times and succeed in many cases.\n\n## Overview\nThis repository allows you to automatically set up Google Cloud resources using Terraform and deploy Dify in a highly available configuration.\n\n## Features\n- Serverless hosting\n- Auto-scaling\n- Data persistence\n\n## Prerequisites\n- Google Cloud account\n- Terraform installed\n- gcloud CLI installed\n\n## Configuration\n- Set environment-specific values in the `terraform/environments/dev/terraform.tfvars` file.\n\n\u003e [!WARNING]\n\u003e **Security Alert: Handling `terraform.tfvars`**\n\u003e The `terraform/environments/dev/terraform.tfvars` file in this repository is a **template only**. Populate it locally with your actual configuration (project ID, secrets, secure password).\n\u003e\n\u003e **Do NOT commit `terraform.tfvars` containing sensitive data to Git.** This poses a significant security risk.\n\u003e\n\u003e Add `*.tfvars` to your `.gitignore` file immediately to prevent accidental commits. For secure secret management, use environment variables (`TF_VAR_...`) or tools like Google Secret Manager.\n\n- Create a GCS bucket to manage Terraform state in advance, and replace \"your-tfstate-bucket\" in the `terraform/environments/dev/provider.tf` file with the name of the created bucket.\n\n## Getting Started\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/DeNA/dify-google-cloud-terraform.git\n    ```\n\n2. Initialize Terraform:\n    ```sh\n    cd terraform/environments/dev\n    terraform init\n    ```\n\n3. Make Artifact Registry repository:\n    ```sh\n    terraform apply -target=module.registry\n    ```\n\n4. Build \u0026 push container images:\n    ```sh\n    cd ../../..\n    sh ./docker/cloudbuild.sh \u003cyour-project-id\u003e \u003cyour-region\u003e\n    ```\n    You can also specify a version of the dify-api image.\n    ```sh\n    sh ./docker/cloudbuild.sh \u003cyour-project-id\u003e \u003cyour-region\u003e \u003cdify-api-version\u003e\n    ```\n    If no version is specified, the latest version is used by default.\n\n5. Terraform plan:\n    ```sh\n    cd terraform/environments/dev\n    terraform plan\n    ```\n\n6. Terraform apply:\n    ```sh\n    terraform apply\n    ```\n\n\n## Cleanup\n```sh\nterraform destroy\n```\n\nNote: Cloud Storage, Cloud SQL, VPC, and VPC Peering cannot be deleted with the `terraform destroy` command. These are critical resources for data persistence. Access the console and carefully delete them. After that, use the `terraform destroy` command to ensure all resources have been deleted.\n\n## References\n- [Dify](https://dify.ai/)\n- [GitHub](https://github.com/langgenius/dify)\n\n## License\nThis software is licensed under the MIT License. See the LICENSE file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdena%2Fdify-google-cloud-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdena%2Fdify-google-cloud-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdena%2Fdify-google-cloud-terraform/lists"}