@fjall/components-infrastructure

中文文档
39.2.2发布于 2026/11/15SEE LICENSE IN LICENSETypeScriptES Module近 30 天下载 9888

Published fjall infrastructure components and utilities.

原始使用文档
文档目录5 节
  1. Upgrade notes
  2. 21.0.0 — ClickHouse identities by workload class (breaking)
  3. Useful commands
  4. Using the constructs
  5. Licence

Fjall Infrastructure

Published fjall infrastructure components and utilities.

Upgrade notes

21.0.0 — ClickHouse identities by workload class (breaking)

ClickHouseDatabase no longer shares one schemaAdmin principal across the migration task, the schema gate and the maintenance sidecars. Each workload class now authenticates as its own identity, so no two classes contend for the same max_concurrent_queries_for_user cap:

identityholder
schemaAdmin.name (XML)migration task ONLY
fjall_schema_gate (SQL)materialised gate container
fjall_maintenance (SQL)OPTIMIZE FINAL + BACKUP tasks

What changes in a synthesised stack:

  • App containers lose SCHEMA_ADMIN_USER / SCHEMA_ADMIN_PASSWORD. They keep EXPECTED_CH_SCHEMA_VERSION. A container image that runs its own in-process ClickHouse schema check reading those two variables must drop it — the materialised gate container performs the check.
  • The gate container authenticates as fjall_schema_gate via FJALL_SCHEMA_GATE_CH_USER / FJALL_SCHEMA_GATE_CH_PASSWORD (read-only, SELECT on <db>._schema_migrations only).
  • The OPTIMIZE and BACKUP scheduled tasks authenticate as fjall_maintenance. Their execution roles read that identity's secret, not the schema admin's. Both scripts open with a migrate ↔ maintenance activity pre-flight and log fjall:maintenance:status=<ok|deferred|failed> markers; status=failed pages via a new ClickHouseMaintenanceFailedAlarm.
  • Two new fixed-name Secrets Manager secrets — fjall/clickhouse/fjall-schema-gate-password and fjall/clickhouse/fjall-maintenance-password — are minted by the construct. They are NOT injected into the ClickHouse service container, so the ClickHouse service task definition is unchanged by the upgrade.
  • The fjall_ user-name prefix is reserved. A schemaAdmin.name or managedPasswords entry starting with fjall_ fails synth.

Deploy order: the identities are SQL-provisioned by the migration runner (@fjall/clickhouse 21 — bump the migration image before this construct), so the migration task must run once under 21.x BEFORE anything authenticates as the new identities. Deploy the Database stack, then the Compute stack that carries the migration task, and only then let the schedules fire.

Rollback: rolling back to 20.x deletes the two framework secrets, which Secrets Manager only schedules (30-day recovery window). Re-adopting 21.x inside that window fails on the held names — first run aws secretsmanager restore-secret --secret-id fjall/clickhouse/<name>-password or aws secretsmanager delete-secret --secret-id … --force-delete-without-recovery for each of the two secrets.

Useful commands

  • npm run build — clean, bundle the Lambda assets and compile TypeScript to dist/
  • npm run watch — recompile on change
  • npm test — run the Vitest suites
  • npm run typecheck — type-check the library

Synthesis and deployment go through the fjall CLI (fjall deploy), which assembles the stacks from an application's fjall/ directory. The package is not deployed with cdk deploy on its own.

Using the constructs

The constructs are consumed through the fjall CLI: fjall create app and fjall add <resource> write the infrastructure.ts that composes them, and fjall deploy synthesises and deploys it. Every construct is also exported from the package root for direct use; the reference lives at docs.fjall.io.

Licence

Proprietary — see LICENSE.

版本与发布记录

@fjall/components-infrastructure 共发布 443 个版本,首次发布于 2023/09/02;过去 12 个月发布了 208 个版本。

版本发布日期距今
39.2.2latest2026/11/15今天
39.2.12026/11/15今天
39.2.02026/11/124 天前
39.1.02026/11/114 天前
39.0.142026/11/114 天前
39.0.132026/11/087 天前

关于 @fjall/components-infrastructure 的常见问题

@fjall/components-infrastructure 是什么?

Published fjall infrastructure components and utilities.

如何安装 @fjall/components-infrastructure?

在项目目录运行 npm install @fjall/components-infrastructure,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:aws-cdk(^2.1134.0)、constructs(^10.7.2)、aws-cdk-lib(^2.265.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 infrastructure,可以用 npx infrastructure 直接运行。

@fjall/components-infrastructure 支持 TypeScript 吗?

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

@fjall/components-infrastructure 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fjall/components-infrastructure 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fjall/components-infrastructure 可以商用吗?

@fjall/components-infrastructure 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@fjall/components-infrastructure 的下载量有多少?

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

@fjall/components-infrastructure 还在维护吗?

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