@axnic/pulumi-garage

中文文档
1.1.2发布于 2026/10/07Apache-2.0TypeScript构建来源已验证近 30 天下载 3953

CI [![GitHub release](https:

原始使用文档
文档目录12 节
  1. Installing
  2. Node.js (JavaScript/TypeScript)
  3. Python
  4. Go
  5. .NET
  6. Quickstart
  7. Configuration
  8. Compatibility
  9. Known limitations
  10. Reference
  11. Contributing
  12. License

CI GitHub release Go Reference npm version PyPI version NuGet version License

Pulumi Garage Provider

A Pulumi native provider for managing Garage, a self-hosted, S3-compatible distributed object storage system, through its Admin API.

It manages three resources: Bucket (with an optional global alias, static-website hosting, and storage quotas), Key (an S3 access key), and BucketKeyPermission (a read/write/owner grant of a Key on a Bucket). Cluster bootstrapping (nodes, zones, capacity, layout) is out of scope - see Known limitations.

[!NOTE] Provenance. This provider was built end-to-end by an AI coding agent (Claude) in an autonomous, "vibe coded" session, without a human reviewing the implementation line by line. That's a deliberate reason the project leans hard on automated testing rather than manual review for confidence: unit tests for the Admin API client and each resource's create/read/update/delete logic, plus a real end-to-end suite that stands up an actual Garage cluster in Docker and exercises it (including a genuine S3 object upload/download through a granted permission) - see CONTRIBUTING.md. Review the code yourself before trusting it with production data.

Installing

This package is available in several languages. Only the Go and YAML SDKs are exercised by this repo's own examples and E2E tests (see Known limitations); the others are generated and published for convenience but are otherwise untested by this project beyond schema-level checks.

Node.js (JavaScript/TypeScript)

npm install @axnic/pulumi-garage

Python

pip install pulumi_garage

Go

go get github.com/axnic/pulumi-garage/sdk/go/pulumi-garage

.NET

dotnet add package Axnic.Pulumi.Garage

The provider binary itself doesn't require any of the above - pulumi plugin install resource garage <version> (or the engine's automatic resolution) fetches it directly from this repo's GitHub Releases, no Pulumi Registry listing required.

Quickstart

Point the provider at your Garage cluster's Admin API, either via stack config:

pulumi config set garage:endpoint http://localhost:3903
pulumi config set garage:adminToken <token> --secret

or the GARAGE_ADMIN_ENDPOINT / GARAGE_ADMIN_TOKEN environment variables. This provider does not bootstrap a Garage cluster for you - see garagehq.deuxfleurs.fr for setting one up (garage layout assign/apply, or --single-node for a single-node cluster).

Then, a minimal YAML program (see examples/yaml/Pulumi.yaml, or examples/go/main.go for the Go equivalent):

name: garage-example-yaml
runtime: yaml

resources:
  myKey:
    type: garage:Key
    properties:
      name: my-app-key
  myBucket:
    type: garage:Bucket
    properties:
      globalAlias: my-app-bucket
  myPermission:
    type: garage:BucketKeyPermission
    properties:
      bucketId: ${myBucket.id}
      accessKeyId: ${myKey.accessKeyId}
      permissions:
        read: true
        write: true

outputs:
  bucketId: ${myBucket.id}
  accessKeyId: ${myKey.accessKeyId}
  secretAccessKey: ${myKey.secretAccessKey}

Configuration

KeyEnv var fallbackDescription
garage:endpointGARAGE_ADMIN_ENDPOINTThe base URL of the Garage Admin API, e.g. "http://localhost:3903".
garage:adminToken (secret)GARAGE_ADMIN_TOKENA bearer token authorized against the Garage Admin API.
garage:s3EndpointGARAGE_S3_ENDPOINTThe base URL of the Garage S3 API, e.g. "http://localhost:3900". Only required for Bucket's lifecycleRules.
garage:s3RegionGARAGE_S3_REGIONThe S3 region to sign requests for. Defaults to "garage" if unset.
garage:accessKeyIdGARAGE_S3_ACCESS_KEY_IDAn access key ID authorized against the Garage S3 API. Only required for lifecycleRules.
garage:secretAccessKey (secret)GARAGE_S3_SECRET_ACCESS_KEYThe secret access key paired with accessKeyId. Only required for lifecycleRules.

endpoint/adminToken are required, one way or the other - the provider fails to configure if neither the config key nor its env var fallback is set. The S3 fields are optional and only needed to manage a Bucket's lifecycleRules (lifecycle rules are reachable only over Garage's S3 API, not its Admin API); if you set any of s3Endpoint/accessKeyId/secretAccessKey, you must set all three.

Compatibility

This provider talks to Garage's Admin API v2, introduced in Garage v2.0.0. Each version below is tested against the full example-program lifecycle (create/update/delete plus a real S3 object upload/download) in its own CI workflow, so its badge reflects that version alone rather than an aggregate:

Garage versionStatus
v2.0.0E2E (Garage v2.0.0)
v2.1.0E2E (Garage v2.1.0)
v2.2.0E2E (Garage v2.2.0)
v2.3.0E2E (Garage v2.3.0)
v2.4.0E2E (Garage v2.4.0)

Each workflow (.github/workflows/merge_group,pull_request,push.e2e-v2.*.yaml) is a thin caller of the central reusable E2E workflow in axnic/.github with that version pinned (new versions are added by that repo's E2E Sync workflow, which opens a PR) - GitHub Actions status badges are per-workflow-file, not per-matrix-leg, which is why this is five small files rather than one strategy.matrix job. --single-node (the fast layout-bootstrap path) only exists from Garage v2.3.0 onward, so docker-compose.yml and scripts/bootstrap-garage.sh always use the manual layout assign/apply bootstrap instead, which works identically across all five versions.

Known limitations

This is a v1, personal/small-org provider - scope is intentionally narrow:

  • No cluster layout management. Assigning nodes, zones, and capacity is not managed by this provider; it's a one-shot bootstrap operation that doesn't fit cleanly into idempotent IaC. Bootstrap your Garage cluster yourself (e.g. garage layout assign/apply, or --single-node on Garage v2.3.0+) before pointing this provider at it.
  • Bucket supports only a single global alias. No local (per-key) aliases, no multiple global aliases.
  • Key's global createBucket permission is not modelled, deliberately - it wasn't reliable enough to model without further verification against a live API.
  • Deleting a non-empty Bucket fails. This mirrors Garage's (and S3's) own native behavior; it's by design, not a bug.
  • Only YAML and Go example programs are exercised in CI/E2E. The nodejs, python, and dotnet SDKs are generated and published (see Installing) but aren't covered by this repo's example programs or lifecycle tests.
  • No Java/Maven SDK. Pulumi's Java support has too little adoption to justify the extra setup cost (Sonatype namespace verification, GPG-signed releases); the nodejs, python, dotnet, and go SDKs cover the ecosystem's actual usage.

Reference

This provider isn't (yet) listed on the Pulumi Registry, so there's no pulumi.com/registry/packages/garage page to link to for generated, per-resource API docs. Until then:

  • The Go SDK reference on pkg.go.dev is generated from the same schema descriptions the Pulumi Registry would render, and is the most complete field-by-field reference available (populated after the first tagged release - see RELEASING.md).
  • The Quickstart and Configuration sections above cover the three resources and provider config end to end; the underlying schema is provider/cmd/pulumi-resource-garage/schema.json (generated, not hand-maintained).

Contributing

See CONTRIBUTING.md for building the provider, the test layers (including how to run the E2E suite locally), generating the SDKs, and the devcontainer setup. See also our Code of Conduct.

License

Apache-2.0

版本与发布记录

@axnic/pulumi-garage 共发布 4 个版本,首次发布于 2026/07/15;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.1.2latest2026/10/071 个月前
1.0.12026/07/153 个月前
1.0.02026/07/153 个月前
1.0.0-alpha.0next2026/07/153 个月前

关于 @axnic/pulumi-garage 的常见问题

@axnic/pulumi-garage 是什么?

[![GitHub release](https:

如何安装 @axnic/pulumi-garage?

在项目目录运行 npm install @axnic/pulumi-garage,或使用 pnpm add / yarn add / bun add。

@axnic/pulumi-garage 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@axnic/pulumi-garage 可以商用吗?

@axnic/pulumi-garage 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@axnic/pulumi-garage 的下载量有多少?

根据 npm 官方下载统计,@axnic/pulumi-garage 在 2026/10/08 – 2026/11/06 这 30 天内被下载 3,953 次,日均约 132 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@axnic/pulumi-garage 还在维护吗?

最新版本 1.1.2 发布于 2026/10/07(1 个月前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/07/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。