@infracraft/pulumi 1.17.2 → 1.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -23
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<b
|
|
2
|
+
<b>@infracraft/pulumi</b>
|
|
3
3
|
<br />
|
|
4
4
|
<i>Pulumi providers for platforms that don't have one.</i>
|
|
5
5
|
</p>
|
|
@@ -24,8 +24,8 @@ Native Pulumi providers with adopt-or-create semantics and deploy orchestration.
|
|
|
24
24
|
| 🎯 | **Fly.io** | `@infracraft/pulumi/fly` | App, Secret, Volume, Certificate, IP, and Deploy resources via the Machines REST API and Fly GraphQL API. |
|
|
25
25
|
| 🤖 | **Agents** | `@infracraft/pulumi/agents` | Emit operating hints for AI coding agents working on the stack. |
|
|
26
26
|
| #️⃣ | **Hash** | `@infracraft/pulumi/hash` | Deterministic directory/env-var/app hashing for deploy triggers. |
|
|
27
|
-
| 📦 | **Sandbox** | `@infracraft/pulumi/sandbox` | Isolated `/tmp` working copies for CLI deploys
|
|
28
|
-
| 🔒 | **Git Guard** | `@infracraft/pulumi/git-guard` |
|
|
27
|
+
| 📦 | **Sandbox** | `@infracraft/pulumi/sandbox` | Isolated `/tmp` working copies for CLI deploys. Opt in via `dependsOn`. |
|
|
28
|
+
| 🔒 | **Git Guard** | `@infracraft/pulumi/git-guard` | Swaps a sandboxed deploy's `.git` for a fresh stub. Opt in via `dependsOn`. |
|
|
29
29
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
@@ -242,29 +242,29 @@ import {
|
|
|
242
242
|
} from "@infracraft/pulumi/fly"
|
|
243
243
|
import { hash } from "@infracraft/pulumi/hash"
|
|
244
244
|
|
|
245
|
-
// Provider
|
|
245
|
+
// Provider: auth context (token + optional default org)
|
|
246
246
|
const provider = new FlyProvider("fly", {
|
|
247
247
|
token: config.requireSecret("flyToken"),
|
|
248
248
|
organization: "personal",
|
|
249
249
|
})
|
|
250
250
|
|
|
251
|
-
// App
|
|
251
|
+
// App: adopt-or-create; `.id` is the app name
|
|
252
252
|
const app = new FlyApp("api", { name: "rby-api" }, { provider })
|
|
253
253
|
|
|
254
|
-
// Secrets
|
|
254
|
+
// Secrets: managed via the Machines REST secrets API.
|
|
255
255
|
// `.version` changes only when the secret set changes.
|
|
256
256
|
const secrets = new FlySecret("api-secrets", {
|
|
257
257
|
secrets: { JWT_SECRET: jwt, DATABASE_URL: dbUrl },
|
|
258
258
|
}, { provider, app })
|
|
259
259
|
|
|
260
|
-
// Volume
|
|
260
|
+
// Volume: persistent storage (grow-only)
|
|
261
261
|
new FlyVolume("api-data", {
|
|
262
262
|
name: "data",
|
|
263
263
|
region: "iad",
|
|
264
264
|
sizeGb: 10,
|
|
265
265
|
}, { provider, app })
|
|
266
266
|
|
|
267
|
-
// Certificate
|
|
267
|
+
// Certificate: ACME cert for a custom hostname
|
|
268
268
|
new FlyCertificate("api-cert", {
|
|
269
269
|
hostname: "api.example.com",
|
|
270
270
|
}, { provider, app })
|
|
@@ -272,7 +272,7 @@ new FlyCertificate("api-cert", {
|
|
|
272
272
|
// Dedicated/shared IP (Fly GraphQL API)
|
|
273
273
|
new FlyIp("api-ip", { type: FlyIpType.SHARED_V4 }, { provider, app })
|
|
274
274
|
|
|
275
|
-
// Deploy
|
|
275
|
+
// Deploy: `fly deploy --remote-only` with consumer-controlled triggers.
|
|
276
276
|
// The generated fly.toml content is included in the triggers automatically.
|
|
277
277
|
new FlyDeploy("api-deploy", {
|
|
278
278
|
config: {
|
|
@@ -315,14 +315,14 @@ new FlyDeploy("api-deploy", {
|
|
|
315
315
|
|
|
316
316
|
## Agents
|
|
317
317
|
|
|
318
|
-
Emit operating reminders for AI coding agents (Claude Code, Copilot, etc.) working on the stack. Auto-detects an agent via `CLAUDECODE` / `AI_AGENT` env vars
|
|
318
|
+
Emit operating reminders for AI coding agents (Claude Code, Copilot, etc.) working on the stack. Auto-detects an agent via `CLAUDECODE` / `AI_AGENT` env vars; a no-op for humans unless `enabled` is forced.
|
|
319
319
|
|
|
320
320
|
```typescript
|
|
321
321
|
import * as agents from "@infracraft/pulumi/agents"
|
|
322
322
|
|
|
323
323
|
agents.hint({
|
|
324
324
|
project: [
|
|
325
|
-
"Production branch is `main
|
|
325
|
+
"Production branch is `main`; never destroy it.",
|
|
326
326
|
"All Railway services share one project; only environments are per-feature.",
|
|
327
327
|
],
|
|
328
328
|
// channel: "stderr" (default) | "pulumi-log"
|
|
@@ -340,7 +340,7 @@ Hints are emitted inside a `<infracraft-hint>` block with infracraft defaults (a
|
|
|
340
340
|
|
|
341
341
|
## Hash
|
|
342
342
|
|
|
343
|
-
Produce a stable digest to use as a deploy trigger element. Accepts a source directory path (synchronous, returns `string`), a key-value env var map (returns `Output<string>`), or
|
|
343
|
+
Produce a stable digest to use as a deploy trigger element. Accepts a source directory path (synchronous, returns `string`), a key-value env var map (returns `Output<string>`), or, via `hashApp`, an app directory plus its transitive workspace dependencies.
|
|
344
344
|
|
|
345
345
|
```typescript
|
|
346
346
|
import { hash, hashApp } from "@infracraft/pulumi/hash"
|
|
@@ -348,7 +348,7 @@ import { hash, hashApp } from "@infracraft/pulumi/hash"
|
|
|
348
348
|
// Hash a source directory
|
|
349
349
|
const sourceHash = hash("apps/api")
|
|
350
350
|
|
|
351
|
-
// Hash an app + every workspace package it depends on (transitively)
|
|
351
|
+
// Hash an app + every workspace package it depends on (transitively);
|
|
352
352
|
// a change to a shared packages/* the app uses retriggers its deploy
|
|
353
353
|
const appHash = hashApp(monorepoRoot, "apps/api")
|
|
354
354
|
|
|
@@ -370,7 +370,7 @@ new RailwayDeploy("api-deploy", {
|
|
|
370
370
|
|
|
371
371
|
## Sandbox & Git Guard
|
|
372
372
|
|
|
373
|
-
Deploy isolation as `dependsOn` markers. Listing a `DeploySandbox` in a deploy's `dependsOn` runs that deploy's CLI from an isolated copy of the repo's tracked files under `/tmp/infracraft` (stale sandboxes are garbage-collected automatically). Adding a `GitGuard` swaps the copy's `.git` for a
|
|
373
|
+
Deploy isolation as `dependsOn` markers. Listing a `DeploySandbox` in a deploy's `dependsOn` runs that deploy's CLI from an isolated copy of the repo's tracked files under `/tmp/infracraft` (stale sandboxes are garbage-collected automatically). Adding a `GitGuard` swaps the copy's `.git` for a fresh stub (`git init` + `git add -A`, unborn HEAD).
|
|
374
374
|
|
|
375
375
|
```typescript
|
|
376
376
|
import { DeploySandbox } from "@infracraft/pulumi/sandbox"
|
|
@@ -389,9 +389,9 @@ new VercelDeploy("web-deploy", {
|
|
|
389
389
|
|
|
390
390
|
| `dependsOn` markers | Working copy | `.git` sent to the platform |
|
|
391
391
|
|---|---|---|
|
|
392
|
-
| none | Live repo tree | The real one
|
|
392
|
+
| none | Live repo tree | The real one; whatever the platform CLI picks up |
|
|
393
393
|
| `DeploySandbox` | Isolated `/tmp/infracraft` copy | Real `.git` (copy-on-write copy) |
|
|
394
|
-
| `DeploySandbox` + `GitGuard` | Isolated copy, `excludePaths` applied |
|
|
394
|
+
| `DeploySandbox` + `GitGuard` | Isolated copy, `excludePaths` applied | A fresh stub (`git init` + `git add -A`, unborn HEAD) |
|
|
395
395
|
| `GitGuard` alone | — | Throws: the guard needs a sandbox to act on |
|
|
396
396
|
|
|
397
397
|
### Sandbox & Git Guard API surface
|
|
@@ -399,19 +399,19 @@ new VercelDeploy("web-deploy", {
|
|
|
399
399
|
| Export | Kind | Notes |
|
|
400
400
|
|---|---|---|
|
|
401
401
|
| `DeploySandbox` | ComponentResource | Isolation marker + workspace lifecycle; GCs sandboxes older than 3h |
|
|
402
|
-
| `GitGuard` | ComponentResource |
|
|
403
|
-
| `SandboxMode` | enum | `NONE`, `ORIGINAL`, `STUB
|
|
402
|
+
| `GitGuard` | ComponentResource | Stub-`.git` marker; requires a `DeploySandbox` alongside it |
|
|
403
|
+
| `SandboxMode` | enum | `NONE`, `ORIGINAL`, `STUB`; derived from the markers by the deploy seam |
|
|
404
404
|
| `buildSandboxScript(options)` | function | Builds the sandboxed shell a deploy command runs (used by the deploy resources) |
|
|
405
405
|
| `buildSandboxFileFilter(excludePaths)` | function | Portable awk filter applied to `git ls-files` before the copy |
|
|
406
406
|
| `isDeploySandbox(value)` / `isGitGuard(value)` | functions | Bundle-safe marker checks |
|
|
407
407
|
|
|
408
408
|
## Design
|
|
409
409
|
|
|
410
|
-
**Context-based**: Resources inherit auth, project, and environment from their options
|
|
410
|
+
**Context-based**: Resources inherit auth, project, and environment from their options; no manual ID passing.
|
|
411
411
|
|
|
412
412
|
**Adopt-or-create**: Existing infrastructure is discovered by name and adopted into Pulumi state. Run `pulumi up` against a pre-existing project and it just works.
|
|
413
413
|
|
|
414
|
-
**Consumer-controlled protection**: Use `protect: true` on shared/production resources to prevent accidental deletion. Deploy resources accept a `triggers` array
|
|
414
|
+
**Consumer-controlled protection**: Use `protect: true` on shared/production resources to prevent accidental deletion. Deploy resources accept a `triggers` array; you decide what causes a redeploy.
|
|
415
415
|
|
|
416
416
|
**Consumer-controlled triggers**: Hash source directories, env values, or anything else. Pass results into `triggers` arrays.
|
|
417
417
|
|
|
@@ -420,9 +420,9 @@ new VercelDeploy("web-deploy", {
|
|
|
420
420
|
| Provider | Existing options | Gap |
|
|
421
421
|
|---|---|---|
|
|
422
422
|
| Railway | Nothing. Zero Pulumi providers exist. | **We are the Railway Pulumi provider.** |
|
|
423
|
-
| Neon | Bridged TF provider
|
|
424
|
-
| Vercel | `@pulumiverse/vercel
|
|
425
|
-
| Fly.io | `@ediri/pulumi-fly
|
|
423
|
+
| Neon | Bridged TF provider; fails on pre-existing resources | Adopt-or-create without manual `import` blocks |
|
|
424
|
+
| Vercel | `@pulumiverse/vercel`; no adopt-or-create, no CLI deploys | Adopt-or-create projects + consumer-controlled deploy triggers |
|
|
425
|
+
| Fly.io | `@ediri/pulumi-fly`; bridges a Terraform provider Fly archived March 2024, no secrets support | Hand-rolled `dynamic` resources matching every other provider: secrets, adopt-or-create, consumer-controlled deploys; no unmaintained upstream |
|
|
426
426
|
|
|
427
427
|
## License
|
|
428
428
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infracraft/pulumi",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"description": "Native Pulumi providers for Railway, Neon, Vercel, and Fly.io with adopt-or-create semantics and deploy orchestration. No Terraform bridge.",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/andredezzy/infracraft",
|