{"id":43052562,"url":"https://github.com/cloud-native-toolkit/terraform-provider-gitops","last_synced_at":"2026-01-31T10:38:08.029Z","repository":{"id":37076205,"uuid":"456933082","full_name":"cloud-native-toolkit/terraform-provider-gitops","owner":"cloud-native-toolkit","description":"Terraform provider to wrap the igc cli calls used to populate the gitops repo","archived":false,"fork":false,"pushed_at":"2023-07-12T15:59:58.000Z","size":189,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-22T03:03:00.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloud-native-toolkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-02-08T12:57:48.000Z","updated_at":"2022-04-27T21:04:05.000Z","dependencies_parsed_at":"2024-06-21T01:07:21.373Z","dependency_job_id":"7421bb19-2763-449c-8e9e-83a259f6b843","html_url":"https://github.com/cloud-native-toolkit/terraform-provider-gitops","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.4285714285714286,"last_synced_commit":"d22288f3dd8926f32817e7050125bc0be5306fbc"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"purl":"pkg:github/cloud-native-toolkit/terraform-provider-gitops","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Fterraform-provider-gitops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Fterraform-provider-gitops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Fterraform-provider-gitops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Fterraform-provider-gitops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloud-native-toolkit","download_url":"https://codeload.github.com/cloud-native-toolkit/terraform-provider-gitops/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloud-native-toolkit%2Fterraform-provider-gitops/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28938831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T10:18:23.202Z","status":"ssl_error","status_checked_at":"2026-01-31T10:18:22.693Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-31T10:38:07.974Z","updated_at":"2026-01-31T10:38:08.018Z","avatar_url":"https://github.com/cloud-native-toolkit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Provider Gitops\n\nTerraform provider to populate a Cloud Native Toolkit gitops repo with a new ArgoCD \napplication. Currently, this provider is a simple wrapper for the `gitops-namespace` \nand `gitops-module` commands in the [igc](https://github.com/cloud-native-toolkit/ibm-garage-cloud-cli) cli.\n\nThe provider serves two purposes with this version:\n\n- Provides more terraform-friendly integration with other terraform modules. This provider removes the need for null_resource resources to call the cli.\n- Performs mutex locking on the git username to prevent concurrent access of the git apis and associated rate limits.\n\n## Usage\n\n### Provider configuration\n\nAdd the gitops module to the required providers list:\n\n```hcl\nterraform {\n  required_providers {\n    gitops = {\n      source  = \"cloud-native-toolkit/gitops\"\n    }\n  }\n}\n```\n\nConfigure the provider block:\n\n```hcl\nprovider \"gitops\" {\n  username = var.git_username\n  token = var.git_token\n  bin_dir  = module.setup_clis.bin_dir\n}\n```\n\n**Note:** `username` and `token` are both optional parameters. `bin_dir` should point to the directory where the `igc` cli can be found.\n\n### Gitops Namespace resource\n\nThe Gitops Namespace resource will add namespace configuration to the repo.\n\n```hcl\nresource gitops_namespace ns {\n    name = var.name\n    content_dir = \"${path.module}/yaml\"\n    server_name = var.server_name\n    config = yamlencode(var.config)\n    credentials = yamlencode(var.credentials)\n}\n```\n\n### Gitops Module resource\n\nThe Gitops Module resource will add gitops module/application configutation to the repo.\n\n```hcl\nresource gitops_module module {\n    name = var.name\n    namespace = var.namespace\n    content_dir = \"${path.module}/yaml\"\n    server_name = var.server_name\n    layer = var.layer\n    type = var.type\n    config = yamlencode(var.config)\n    credentials = yamlencode(var.credentials)\n}\n```\n\nThis entry provides a replacement for the following null_resource configuration:\n\n```hcl\nresource null_resource setup_gitops {\n  depends_on = [null_resource.create_yaml]\n\n  triggers = {\n    name = local.name\n    namespace = var.namespace\n    yaml_dir = local.yaml_dir\n    server_name = var.server_name\n    layer = local.layer\n    type = local.type\n    git_credentials = yamlencode(var.git_credentials)\n    gitops_config   = yamlencode(var.gitops_config)\n    bin_dir = local.bin_dir\n  }\n\n  provisioner \"local-exec\" {\n    command = \"${self.triggers.bin_dir}/igc gitops-module '${self.triggers.name}' -n '${self.triggers.namespace}' --contentDir '${self.triggers.yaml_dir}' --serverName '${self.triggers.server_name}' -l '${self.triggers.layer}' --type '${self.triggers.type}'\"\n\n    environment = {\n      GIT_CREDENTIALS = nonsensitive(self.triggers.git_credentials)\n      GITOPS_CONFIG   = self.triggers.gitops_config\n    }\n  }\n\n  provisioner \"local-exec\" {\n    when = destroy\n    command = \"${self.triggers.bin_dir}/igc gitops-module '${self.triggers.name}' -n '${self.triggers.namespace}' --delete --contentDir '${self.triggers.yaml_dir}' --serverName '${self.triggers.server_name}' -l '${self.triggers.layer}' --type '${self.triggers.type}'\"\n\n    environment = {\n      GIT_CREDENTIALS = nonsensitive(self.triggers.git_credentials)\n      GITOPS_CONFIG   = self.triggers.gitops_config\n    }\n  }\n}\n```\n\n## Development\n\n### Build the application\n\nRun the following command to build the provider\n\n```shell\nmake build\n```\n\n## Test sample configuration\n\nFirst, build and install the provider.\n\n```shell\nmake install\n```\n\nThen, run the following command to initialize the workspace and apply the sample configuration.\n\n```shell\nterraform init \u0026\u0026 terraform apply\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-native-toolkit%2Fterraform-provider-gitops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloud-native-toolkit%2Fterraform-provider-gitops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloud-native-toolkit%2Fterraform-provider-gitops/lists"}