{"id":23090906,"url":"https://github.com/timtorchen/terraform-module-grafana-rule-groups","last_synced_at":"2026-01-17T18:39:14.162Z","repository":{"id":265850563,"uuid":"867462603","full_name":"timtorChen/terraform-module-grafana-rule-groups","owner":"timtorChen","description":"Terraform helper module to create grafana alerts from json/yaml document","archived":false,"fork":false,"pushed_at":"2024-10-09T02:27:11.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T18:03:35.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/timtorChen/grafana-rule-groups/module/latest","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/timtorChen.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-10-04T05:44:46.000Z","updated_at":"2024-10-10T04:50:58.000Z","dependencies_parsed_at":"2024-12-01T08:22:45.740Z","dependency_job_id":null,"html_url":"https://github.com/timtorChen/terraform-module-grafana-rule-groups","commit_stats":null,"previous_names":["timtorchen/terraform-module-grafana-rule-groups"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timtorChen%2Fterraform-module-grafana-rule-groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timtorChen%2Fterraform-module-grafana-rule-groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timtorChen%2Fterraform-module-grafana-rule-groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timtorChen%2Fterraform-module-grafana-rule-groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timtorChen","download_url":"https://codeload.github.com/timtorChen/terraform-module-grafana-rule-groups/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247052618,"owners_count":20875685,"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":[],"created_at":"2024-12-16T21:16:32.844Z","updated_at":"2026-01-17T18:39:14.085Z","avatar_url":"https://github.com/timtorChen.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform grafana rule groups module\n\n⚠️ This project is still under development; use it with caution.\n\nThe helper module to create grafana alerts from document following rule-groups [schema](./schema.json).\n\n## Usage\n\nLoad rule groups document with `static_rule_groups` and customize fine-grained control on each rule with `rule_groups` dynamic variable.\n\n```tf\n# main.tf\nresource \"grafana_data_source\" \"prometheus\" {\n}\n\nmodule \"alert\" {\n  source  = \"timtorChen/grafana-rule-groups/module\"\n  version = \"0.1.0\"\n\n  folder_name        = \"node\"\n  datasource_uid     = grafana_data_source.prometheus.uid\n  static_rule_groups = yamldecode(templatefile(\"${path.module}/node-exporter-rules.yaml\", {}))\n  rule_groups        = {}\n}\n```\n\n```yaml\n# node-exporter-rules.yaml\n---\n# yaml-language-server: $schema=https://raw.githubusercontent.com/timtorChen/terraform-module-grafana-rule-groups/refs/heads/main/schema.json\n- name: metrics-check\n  interval_seconds: 300\n  rules:\n    - name: node-no-data\n      annotations:\n        summary: \"Node-exporter metrics return NoData\"\n        description: \u003e-\n          Node-exporter metrics has been no data for 5 minutes.\n          Please check if node-exporter or Prometheus is working.\n      condition: \"Z\"\n      datas:\n        - ref_id: \"Z\"\n          model:\n            expr: \"absent(node_uname_info) or vector(0)\"\n            instant: true\n      no_data_state: \"Alerting\"\n      exec_err_state: \"Error\"\n      for: \"5m\"\n      labels:\n        severity: \"critical\"\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n\n## Requirements\n\n| Name                                                               | Version |\n| ------------------------------------------------------------------ | ------- |\n| \u003ca name=\"requirement_grafana\"\u003e\u003c/a\u003e [grafana](#requirement_grafana) | 3.7.0   |\n\n## Providers\n\n| Name                                                         | Version |\n| ------------------------------------------------------------ | ------- |\n| \u003ca name=\"provider_grafana\"\u003e\u003c/a\u003e [grafana](#provider_grafana) | 3.7.0   |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name                                                                                                               | Type     |\n| ------------------------------------------------------------------------------------------------------------------ | -------- |\n| [grafana_folder.this](https://registry.terraform.io/providers/grafana/grafana/3.7.0/docs/resources/folder)         | resource |\n| [grafana_rule_group.this](https://registry.terraform.io/providers/grafana/grafana/3.7.0/docs/resources/rule_group) | resource |\n\n## Inputs\n\n| Name                                                                                    | Description | Type          | Default | Required |\n| --------------------------------------------------------------------------------------- | ----------- | ------------- | ------- | :------: |\n| \u003ca name=\"input_folder_name\"\u003e\u003c/a\u003e [folder_name](#input_folder_name)                      | n/a         | `string`      | n/a     |   yes    |\n| \u003ca name=\"input_labels\"\u003e\u003c/a\u003e [labels](#input_labels)                                     | n/a         | `map(string)` | `{}`    |    no    |\n| \u003ca name=\"input_annotations\"\u003e\u003c/a\u003e [annotations](#input_annotations)                      | n/a         | `map(string)` | `{}`    |    no    |\n| \u003ca name=\"input_datasource_uid\"\u003e\u003c/a\u003e [datasource_uid](#input_datasource_uid)             | n/a         | `string`      | `\"\"`    |    no    |\n| \u003ca name=\"input_static_rule_groups\"\u003e\u003c/a\u003e [static_rule_groups](#input_static_rule_groups) | n/a         | `any`         | n/a     |   yes    |\n| \u003ca name=\"input_rule_groups\"\u003e\u003c/a\u003e [rule_groups](#input_rule_groups)                      | n/a         | `any`         | n/a     |   yes    |\n\n## Outputs\n\nNo outputs.\n\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimtorchen%2Fterraform-module-grafana-rule-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimtorchen%2Fterraform-module-grafana-rule-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimtorchen%2Fterraform-module-grafana-rule-groups/lists"}