{"id":46194773,"url":"https://github.com/hcloud-talos/terraform-provider-imager","last_synced_at":"2026-05-07T23:16:24.739Z","repository":{"id":341705904,"uuid":"1160423856","full_name":"hcloud-talos/terraform-provider-imager","owner":"hcloud-talos","description":"Uploads Talos disk images into Hetzner Cloud","archived":false,"fork":false,"pushed_at":"2026-05-01T17:47:16.000Z","size":84,"stargazers_count":8,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T19:29:26.804Z","etag":null,"topics":["hcloud","hetzner","hetzner-cloud","talos","talos-linux","terraform"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hcloud-talos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["hcloud-talos"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"mrclrchtr","thanks_dev":null,"custom":null}},"created_at":"2026-02-17T23:19:29.000Z","updated_at":"2026-04-18T21:37:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hcloud-talos/terraform-provider-imager","commit_stats":null,"previous_names":["hcloud-talos/terraform-provider-imager"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/hcloud-talos/terraform-provider-imager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcloud-talos%2Fterraform-provider-imager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcloud-talos%2Fterraform-provider-imager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcloud-talos%2Fterraform-provider-imager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcloud-talos%2Fterraform-provider-imager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hcloud-talos","download_url":"https://codeload.github.com/hcloud-talos/terraform-provider-imager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcloud-talos%2Fterraform-provider-imager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32759585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"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":["hcloud","hetzner","hetzner-cloud","talos","talos-linux","terraform"],"created_at":"2026-03-03T02:14:24.907Z","updated_at":"2026-05-07T23:16:24.734Z","avatar_url":"https://github.com/hcloud-talos.png","language":"Go","funding_links":["https://github.com/sponsors/hcloud-talos","https://buymeacoffee.com/mrclrchtr","https://www.buymeacoffee.com/mrclrchtr","https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=\u0026slug=mrclrchtr\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://github.com/hcloud-talos/terraform-hcloud-talos/blob/main/.idea/icon.png?raw=true\" alt=\"Terraform - Hcloud - Talos\" width=\"200\"/\u003e\n  \u003ch1\u003eTerraform Provider: imager\u003c/h1\u003e\n  \u003cimg alt=\"GitHub Release\" src=\"https://img.shields.io/github/v/release/hcloud-talos/terraform-provider-imager?logo=github\"\u003e\n  \u003cp\u003eUpload Talos disk images into Hetzner Cloud and turn them into reusable snapshot images.\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://hetzner.cloud/?ref=9EF3RYocQW8y\"\u003eNew to Hetzner? Get 20EUR credit (and support this project)!\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://www.buymeacoffee.com/mrclrchtr\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=\u0026slug=mrclrchtr\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff\" alt=\"Buy me a coffee\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cp\u003eIf this provider saved you time or money, consider supporting ongoing maintenance.\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\nThis repository contains a [Terraform provider](https://registry.terraform.io/providers/hcloud-talos/imager) for importing Talos `*.raw.xz` disk images into Hetzner Cloud.\nIt does this by creating a temporary rescue server, writing the image to disk, snapshotting it, and cleaning up the temporary resources afterwards.\n\n- Use it when you want Talos snapshots managed from Terraform instead of building them manually.\n- It fits especially well with Talos Image Factory URLs and the `siderolabs/talos` provider.\n- The provider currently exposes a single resource: `imager_image`.\n\n\u003e [!WARNING]\n\u003e This provider is still alpha quality and not heavily battle-tested yet.\n\u003e Review created Hetzner Cloud resources and costs after apply and destroy.\n\n---\n\n## Quick Start\n\nThe provider uses `HCLOUD_TOKEN` by default. If you prefer, you can also set `token` explicitly in the provider block.\n\n```hcl\nterraform {\n  required_version = \"\u003e= 1.9.0\"\n\n  required_providers {\n    imager = {\n      source  = \"hcloud-talos/imager\"\n      version = \"~\u003e 0.1\"\n    }\n  }\n}\n\nprovider \"imager\" {}\n\nresource \"imager_image\" \"talos_x86\" {\n  image_url    = \"https://factory.talos.dev/image/\u003cschematic-id\u003e/v1.12.4/hcloud-amd64.raw.xz\"\n  architecture = \"x86\"\n}\n```\n\nIf you omit optional arguments, the provider still creates a usable snapshot:\n\n- `location` defaults to `fsn1`.\n- `description` is generated automatically.\n- Default snapshot labels are added for `os`, `creator`, and `arch`.\n\n## How It Works\n\n1. Terraform reads a public `https://...raw.xz` URL.\n2. The provider creates a temporary Hetzner rescue server.\n3. The image is written to the root disk and converted into a snapshot.\n4. The snapshot is kept, and temporary upload resources are deleted.\n\nThis is mainly useful as a building block for cluster modules such as [terraform-hcloud-talos](https://github.com/hcloud-talos/terraform-hcloud-talos), where snapshot creation needs to happen before cluster provisioning.\n\n## Talos Image Factory Workflow\n\nA common setup is to generate the disk image URL with Terraform Provider Talos and then hand that URL to `imager_image`:\n\n```hcl\ndata \"talos_image_factory_urls\" \"hcloud_amd64\" {\n  talos_version = var.talos_version\n  schematic_id  = talos_image_factory_schematic.this.id\n  platform      = \"hcloud\"\n  architecture  = \"amd64\"\n}\n\nresource \"imager_image\" \"talos_x86\" {\n  image_url    = data.talos_image_factory_urls.hcloud_amd64.urls.disk_image\n  architecture = \"x86\"\n\n  labels = {\n    version = var.talos_version\n  }\n}\n```\n\nArchitecture names differ between Talos and Hetzner:\n\n- Talos `amd64` maps to provider `x86`.\n- Talos `arm64` maps to provider `arm`.\n\nSee [examples/talos-image-factory/main.tf](examples/talos-image-factory/main.tf) for the complete example.\n\n## Behavior and Defaults\n\n### Input Requirements\n\n- `image_url` must be a public `https://` URL.\n- `image_url` must end in `.raw.xz`.\n- The provider is intended for Talos `*.raw.xz` disk images, especially Hetzner Cloud images from Image Factory.\n- `architecture` must be `x86` or `arm`.\n- `labels` must follow Hetzner Cloud label rules. In particular, label values cannot contain `/`.\n\n### Snapshot Metadata\n\n- Default labels are always applied: `os=talos`, `creator=hcloud-talos-imager`, and `arch=\u003carchitecture\u003e`.\n- User-supplied `labels` are merged on top of those defaults.\n- If `description` is omitted, the provider derives one from `labels.version` when present, otherwise from the Talos version embedded in the image URL when possible.\n- The resource exposes `id`, `image_id`, and `effective_labels` after creation.\n\n### Lifecycle Semantics\n\n- Destroying `imager_image` deletes the resulting Hetzner snapshot image.\n- Protect shared snapshots with `lifecycle { prevent_destroy = true }`.\n- Changing `image_url`, `architecture`, `location`, `server_type`, or `debug_skip_cleanup` recreates the snapshot by running the upload again.\n- Changing `description` updates the existing snapshot in place. `labels` are managed on the snapshot without a re-upload.\n- Set `debug_skip_cleanup = true` only when you need to inspect a failed upload manually. This intentionally leaves temporary resources behind.\n- Use the `timeouts` block if you need longer create, read, or delete timeouts for slow uploads.\n\n```hcl\nlifecycle {\n  prevent_destroy = true\n}\n\ntimeouts {\n  create = \"20m\"\n}\n```\n\n## Documentation\n\n- Provider docs: [docs/index.md](docs/index.md)\n- Resource docs: [docs/resources/image.md](docs/resources/image.md)\n\n## Cleanup\n\nIf an upload fails at the wrong time, temporary servers or SSH keys can remain in your Hetzner project. The helper CLI can attempt cleanup of resources labeled by the upstream upload library:\n\n```bash\nHCLOUD_TOKEN=... mise run cleanup\n```\n\nYou can also run the command directly:\n\n```bash\nHCLOUD_TOKEN=... go run ./cmd/imager-cleanup\n```\n\n## Development\n\nFor provider development, install the pinned toolchain and hooks:\n\n```bash\nmise install\nmise run hooks\n```\n\nUseful local commands:\n\n```bash\nmise run test\nmise run test:acc\nmise run fix\nmise run check\nmise run build\nmise run docs:gen\n```\n\nFor local Terraform testing with `dev_overrides`, see [dev/local-terraform/README.md](dev/local-terraform/README.md).\n\nAcceptance tests create real Hetzner Cloud resources and are billable. They require `TF_ACC=1`, `HCLOUD_TOKEN`, and `IMAGER_TEST_IMAGE_URL`.\n\n## Credits\n\nThis provider builds on top of the excellent [apricote/hcloud-upload-image](https://github.com/apricote/hcloud-upload-image) project by [@apricote](https://github.com/apricote).\nThanks for creating and maintaining it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcloud-talos%2Fterraform-provider-imager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcloud-talos%2Fterraform-provider-imager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcloud-talos%2Fterraform-provider-imager/lists"}