{"id":18834469,"url":"https://github.com/fgouteroux/terraform-provider-loki","last_synced_at":"2025-09-09T22:49:55.880Z","repository":{"id":183682028,"uuid":"670497752","full_name":"fgouteroux/terraform-provider-loki","owner":"fgouteroux","description":"This terraform provider allows you to interact with grafana loki. ","archived":false,"fork":false,"pushed_at":"2025-02-26T13:35:50.000Z","size":144,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-09T17:43:04.174Z","etag":null,"topics":["grafana","loki","terraform","terraform-provider"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/providers/fgouteroux/loki/latest/docs","language":"Go","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/fgouteroux.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,"zenodo":null}},"created_at":"2023-07-25T07:27:41.000Z","updated_at":"2025-05-06T06:24:00.000Z","dependencies_parsed_at":"2023-07-25T12:50:19.795Z","dependency_job_id":"0e02b8de-ae01-40a4-baf3-59137533998a","html_url":"https://github.com/fgouteroux/terraform-provider-loki","commit_stats":null,"previous_names":["fgouteroux/terraform-provider-loki"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fgouteroux/terraform-provider-loki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fterraform-provider-loki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fterraform-provider-loki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fterraform-provider-loki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fterraform-provider-loki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fgouteroux","download_url":"https://codeload.github.com/fgouteroux/terraform-provider-loki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fterraform-provider-loki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274375469,"owners_count":25273829,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["grafana","loki","terraform","terraform-provider"],"created_at":"2024-11-08T02:12:34.627Z","updated_at":"2025-09-09T22:49:55.860Z","avatar_url":"https://github.com/fgouteroux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform provider for grafana loki\n\nThis terraform provider allows you to interact with grafana loki.\n\nSee [Loki API Reference](https://grafana.com/docs/loki/latest/api/)\n\n## Provider `loki`\n\nExample:\n\n```\nprovider \"loki\" {\n  uri = \"http://localhost:3100\"\n  org_id = \"mytenant\"\n}\n```\n\n\n### Authentication\n\nGrafana Loki have no authentication support, so this is delegated to a reverse proxy.\n\nThe provider support basic auth, token.\n\n#### Basic auth\n\n```\nprovider \"loki\" {\n  uri = \"http://localhost:3100\"\n  org_id = \"mytenant\"\n  username = \"user\"\n  password = \"password\"\n}\n```\n\n#### Token\n\n```\nprovider \"loki\" {\n  uri = \"http://localhost:3100\"\n  org_id = \"mytenant\"\n  token = \"supersecrettoken\"\n}\n```\n\n### Headers\n\n```\nprovider \"loki\" {\n  uri = \"http://localhost:3100\"\n  org_id = \"mytenant\"\n  header = {\n    \"Custom-Auth\" = \"Custom value\"\n  }\n}\n```\n\n## Resource `loki_rule_group_alerting`\n\nExample:\n\n```\nresource \"loki_rule_group_alerting\" \"test\" {\n  name      = \"test1\"\n  namespace = \"namespace1\"\n  rule {\n    alert       = \"HighPercentageError\"\n    expr        = \u003c\u003cEOT\nsum(rate({app=\"foo\", env=\"production\"} |= \"error\" [5m])) by (job)\n  /\nsum(rate({app=\"foo\", env=\"production\"}[5m])) by (job)\n  \u003e 0.05\n    for         = \"10m\"\n    labels      = {\n      severity = \"warning\"\n    }\n    annotations = {\n      summary = \"High request latency\"\n    }\n  }\n}\n```\n\n## Resource `loki_rule_group_recording`\n\nExample:\n\n```\nresource \"loki_rule_group_recording\" \"record\" {\n  name      = \"test1\"\n  namespace = \"namespace1\"\n  interval  = \"1m\"\n  rule {\n    expr   = \"sum(rate({container=\\\"nginx\\\"}[1m]))\"\n    record = \"nginx:requests:rate1m\"\n  }\n}\n```\n\n## Importing existing resources\nThis provider supports importing existing resources into the terraform state. Import is done according to the various provider/resource configuation settings to contact the API server and obtain data.\n\n### loki alerting rule group\n\nTo import loki rule group alerting\nThe id is build as `\u003cnamespace\u003e/\u003cname\u003e`\n\nExample:\n\n```\nterraform import 'loki_rule_group_alerting.alert1' namespace1/alert1\nloki_rule_group_alerting.alert1: Importing from ID \"namespace1/alert1\"...\nloki_rule_group_alerting.alert1: Import prepared!\n  Prepared loki_rule_group_alerting for import\nloki_rule_group_alerting.alert1: Refreshing state... [id=namespace1/alert1]\n\nImport successful!\n\nThe resources that were imported are shown above. These resources are now in\nyour Terraform state and will henceforth be managed by Terraform.\n\n```\n\n### loki recording rule group\n\nTo import loki rule group recording\nThe id is build as `\u003cnamespace\u003e/\u003cname\u003e`\n\nExample:\n\n```\nterraform import 'loki_rule_group_recording.record1' namespace1/record1\nloki_rule_group_recording.record1: Importing from ID \"namespace1/record1\"...\nloki_rule_group_recording.record1: Import prepared!\n  Prepared loki_rule_group_recording for import\nloki_rule_group_recording.record1: Refreshing state... [id=namespace1/record1]\n\nImport successful!\n\nThe resources that were imported are shown above. These resources are now in\nyour Terraform state and will henceforth be managed by Terraform.\n\n```\n\n## Contributing\nPull requests are always welcome! Please be sure the following things are taken care of with your pull request:\n* `go fmt` is run before pushing\n* Be sure to add a test case for new functionality (or explain why this cannot be done)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgouteroux%2Fterraform-provider-loki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgouteroux%2Fterraform-provider-loki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgouteroux%2Fterraform-provider-loki/lists"}