{"id":15221659,"url":"https://github.com/googlecloudplatform/terraform-google-log-analysis","last_synced_at":"2025-10-20T00:32:39.603Z","repository":{"id":58580422,"uuid":"524062589","full_name":"GoogleCloudPlatform/terraform-google-log-analysis","owner":"GoogleCloudPlatform","description":"Stores and analyzes log data","archived":false,"fork":false,"pushed_at":"2024-10-30T17:56:03.000Z","size":478,"stargazers_count":23,"open_issues_count":4,"forks_count":8,"subscribers_count":17,"default_branch":"main","last_synced_at":"2024-12-18T08:41:29.157Z","etag":null,"topics":["cft-terraform","data-analytics"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/GoogleCloudPlatform/log-analysis/google","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoogleCloudPlatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-12T11:28:50.000Z","updated_at":"2024-10-30T17:55:54.000Z","dependencies_parsed_at":"2024-01-14T06:53:00.213Z","dependency_job_id":"70399f99-fe24-4c4d-a8a8-b6247222f054","html_url":"https://github.com/GoogleCloudPlatform/terraform-google-log-analysis","commit_stats":{"total_commits":124,"total_committers":15,"mean_commits":8.266666666666667,"dds":0.7258064516129032,"last_synced_commit":"27937f0513b8dd2eec9299c4fc582d0dbecf47bd"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-log-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-log-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-log-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoogleCloudPlatform%2Fterraform-google-log-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoogleCloudPlatform","download_url":"https://codeload.github.com/GoogleCloudPlatform/terraform-google-log-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237236958,"owners_count":19277082,"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":["cft-terraform","data-analytics"],"created_at":"2024-09-28T15:06:38.338Z","updated_at":"2025-10-20T00:32:34.253Z","avatar_url":"https://github.com/GoogleCloudPlatform.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log analysis pipeline\n\nThe resources/services/activations/deletions that this module will create/trigger are:\n\n- Create a GCS bucket to ingest external log files\n- Create a Cloud Run service to host a sample website\n- Create a table in BigQuery to store logs\n- Set up Logs Router to route Cloud Run web access logs to BigQuery\n- Set up a BigQuery Data Transfer Service to transfer external logs in the Cloud Storage bucket to the BigQuery table\n\n### Tagline\nCreate a pipeline to analyze logs across environments.\n\n### Detailed\nCreate a pipeline to analyze various data and logs of applications running across different environments like Google Cloud, other clouds and on-premises\nYou can choose whether to deploy your solution through the console directly or download as Terraform on GitHub to deploy later.\n\n### Architecture\n1. A web server deployed on Cloud Run generates web access logs when a user visits a sample website deployed on it. The web access logs are automatically sent to Logging.\n1. Logging then routes the logs to a designated table in BigQuery per sink configured.\n1. Files that contain application logs can be uploaded into a bucket in Cloud Storage. (This solution deploys a text file that contains a sample web access log in JSON format.)\n1. BigQuery Data Transfer Service then periodically loads the file to a designated table in BigQuery per transfer configured.\n1. You can run queries against the logs in the table or use Data Studio to visualize the logs.\n\n## Documentation\n- [Architecture Diagram](https://github.com/GoogleCloudPlatform/terraform-google-log-analysis/blob/main/assets/log_analysis_pipeline_v1.svg)\n\n## Usage\n\nBasic usage of this module is as follows:\n\n```hcl\nmodule \"log_analysis\" {\n  source  = \"GoogleCloudPlatform/log-analysis/google\"\n  version = \"~\u003e 0.4\"\n\n  project_id  = \"\u003cPROJECT ID\u003e\"\n}\n```\n\nFunctional examples are included in the\n[examples](./examples/) directory.\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| delete\\_contents\\_on\\_destroy | If set to true, delete all BQ resources. | `bool` | `false` | no |\n| deployment\\_name | The name used to provision resources with. | `string` | `\"log-analysis\"` | no |\n| enable\\_apis | Whether or not to enable underlying apis in this solution. | `string` | `true` | no |\n| labels | A set of key/value label pairs to assign to the resources deployed by this blueprint. | `map(string)` | `{}` | no |\n| project\\_id | The project ID to provision resources to. | `string` | n/a | yes |\n| region | The Google Cloud region name to provision resources in. | `string` | `\"us-central1\"` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| bigquery\\_dataset\\_name | The BigQuery dataset name which the transferred log table is in |\n| bigquery\\_dataset\\_url | The URL to the dataset in the BigQuery UI where you see the tables for logs stored |\n| bigquery\\_table\\_name | The BigQuery table name for transferred logs |\n| bucket\\_name | The Cloud Storage bucket to ingest logs from external soruces |\n| datastudio\\_report\\_url | The URL to create a new Looker Studio report that runs queries against the table for transferred logs via BigQuery Data Trasfer Service |\n| deployment\\_id | The random ID generated for each deployment |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Requirements\n\nThese sections describe requirements for using this module.\n\n### Software\n\nThe following dependencies must be available:\n\n- [Terraform][terraform] v0.13\n- [Terraform Provider for GCP][terraform-provider-gcp] plugin v4.29.0\n\n### Service Account\n\nA service account with the following roles must be used to provision\nthe resources of this module:\n\n- Storage Admin: `roles/storage.admin`\n- Cloud Run Admin: `roles/run.admin`\n- BigQuery Admin: `roles/bigquery.admin`\n- Service Account User: `roles/iam.serviceAccountUser`\n- Service Account Admin: `roles/iam.serviceAccountAdmin`\n- Project IAM Admin: `roles/resourcemanager.projectIamAdmin`\n- Logs Configuration Writer: `roles/logging.configWriter`\n- Service Usage Admin: `roles/serviceusage.serviceUsageAdmin`\n\nThe [Project Factory module][project-factory-module] and the\n[IAM module][iam-module] may be used in combination to provision a\nservice account with the necessary roles applied.\n\n### APIs\n\nA project with the following APIs enabled must be used to host the\nresources of this module:\n\n- IAM API: `iam.googleapis.com`\n- Cloud Resource Manager API: `cloudresourcemanager.googleapis.com`\n- Service Usage API: `serviceusage.googleapis.com`\n- Compute Engine API: `compute.googleapis.com`\n- Cloud Storage API: `storage-api.googleapis.com`\n- Cloud Logging API: `logging.googleapis.com`\n- Cloud Run API: `run.googleapis.com`\n- BigQuery API: `bigquery.googleapis.com`\n- BigQuery Data Transfer API: `bigquerydatatransfer.googleapis.com`\n\nThe [Project Factory module][project-factory-module] can be used to\nprovision a project with the necessary APIs enabled.\n\n## Contributing\n\nRefer to the [contribution guidelines](./CONTRIBUTING.md) for\ninformation on contributing to this module.\n\n[iam-module]: https://registry.terraform.io/modules/terraform-google-modules/iam/google\n[project-factory-module]: https://registry.terraform.io/modules/terraform-google-modules/project-factory/google\n[terraform-provider-gcp]: https://www.terraform.io/docs/providers/google/index.html\n[terraform]: https://www.terraform.io/downloads.html\n\n## Security Disclosures\n\nPlease see our [security disclosure process](./SECURITY.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-log-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-log-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglecloudplatform%2Fterraform-google-log-analysis/lists"}