{"id":51598985,"url":"https://github.com/e2b-dev/terraform-provider-kopsutils","last_synced_at":"2026-07-11T20:30:56.869Z","repository":{"id":365580371,"uuid":"1272825352","full_name":"e2b-dev/terraform-provider-kopsutils","owner":"e2b-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-18T01:09:49.000Z","size":0,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T02:05:13.948Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e2b-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-18T01:08:29.000Z","updated_at":"2026-06-18T01:08:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/e2b-dev/terraform-provider-kopsutils","commit_stats":null,"previous_names":["e2b-dev/terraform-provider-kopsutils"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/e2b-dev/terraform-provider-kopsutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2b-dev%2Fterraform-provider-kopsutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2b-dev%2Fterraform-provider-kopsutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2b-dev%2Fterraform-provider-kopsutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2b-dev%2Fterraform-provider-kopsutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e2b-dev","download_url":"https://codeload.github.com/e2b-dev/terraform-provider-kopsutils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e2b-dev%2Fterraform-provider-kopsutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35375152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"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":[],"created_at":"2026-07-11T20:30:56.141Z","updated_at":"2026-07-11T20:30:56.863Z","avatar_url":"https://github.com/e2b-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-provider-kopsutils\n\nA small Terraform/OpenTofu provider that exposes kОps' name-truncation helpers,\nOCI image digest resolution, and OIDC service-account JWKS generation as data\nsources, so HCL can compute kОps-equivalent values natively instead of relying\non precomputed inputs.\n\nThe truncation kОps applies (an `fnv32a` hash, `base32hex`-encoded and\ntruncated) cannot be expressed in pure HCL. The `gce-cluster` module uses this\nprovider's `kopsutils_limited_length_name` data source to compute the\ninstance-template `name_prefix` directly and the `kopsutils_cluster_hash` data\nsource to compute the service-account truncation hash.\n\nThe logic in `internal/truncate`, `internal/jwks`, and `internal/ociref` is a\nbyte-for-byte port of the corresponding kОps helpers, verified against golden\nvalues in the package tests.\n\n## Data sources\n\n### `kopsutils_limited_length_name`\n\nComputes `gce.LimitedLengthName(input, max_length)`.\n\n| field        | type   | role     | description                                              |\n| ------------ | ------ | -------- | -------------------------------------------------------- |\n| `input`      | string | required | name to (possibly) truncate                              |\n| `max_length` | number | required | maximum length of the result                             |\n| `result`     | string | computed | `input` unchanged if it fits, else `base[:max-7]-\u003chash6\u003e` |\n\n### `kopsutils_cluster_hash`\n\nComputes `lower(base32hex(fnv32a(SafeClusterName(cluster_name))))[:length]`.\n\n| field          | type   | role     | description                                  |\n| -------------- | ------ | -------- | -------------------------------------------- |\n| `cluster_name` | string | required | dotted cluster name, e.g. `k8s1.example.dev` |\n| `length`       | number | optional | hash chars to keep (default `6`)             |\n| `result`       | string | computed | the cluster name hash                        |\n\n### `kopsutils_oci_reference`\n\nResolves an OCI image to an immutable, digest-pinned reference by querying the\nregistry (the same way kОps pins images: `crane.Digest` with the default\nkeychain).\n\n| field       | type   | role     | description                                       |\n| ----------- | ------ | -------- | ------------------------------------------------- |\n| `image`     | string | required | repository without tag/digest                     |\n| `tag`       | string | required | image tag                                         |\n| `platform`  | string | optional | `os/arch[/variant]`; omit for the index digest    |\n| `digest`    | string | computed | resolved manifest digest (`sha256:...`)           |\n| `reference` | string | computed | fully-pinned `image:tag@digest`                   |\n\n### `kopsutils_service_account_jwks`\n\nBuilds the cluster's OIDC JSON Web Key Set (the `/openid/v1/jwks` document) from\nthe service-account public key(s), byte-identically to kОps.\n\n| field                         | type   | role     | description                              |\n| ----------------------------- | ------ | -------- | ---------------------------------------- |\n| `service_account_public_keys` | string | required | service-account public key PEM(s)        |\n| `json`                        | string | computed | the full JWKS document                   |\n| `keys`                        | list   | computed | structured JWK entries (kid/kty/use/alg/n/e) |\n\n## Requirements\n\n- [Terraform](https://developer.hashicorp.com/terraform/downloads) \u003e= 1.0\n- [Go](https://golang.org/doc/install) \u003e= 1.25\n\n\u003e The provider depends on `terraform-plugin-framework`, whose module graph\n\u003e requires `go \u003e= 1.25`.\n\n## Building the Provider\n\n```shell\ngo install\n```\n\nThis builds the provider and puts the binary in the `$GOPATH/bin` directory.\n\n## Developing the Provider\n\nTo generate or update documentation, run `make generate`.\n\nTo run the unit tests:\n\n```shell\ngo test ./...\n```\n\nIn order to run the full suite of acceptance tests, run `make testacc`.\n\n*Note:* Acceptance tests create real resources, and often cost money to run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe2b-dev%2Fterraform-provider-kopsutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe2b-dev%2Fterraform-provider-kopsutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe2b-dev%2Fterraform-provider-kopsutils/lists"}