Skip to content

Coming from Pulumi

If you use Pulumi in Python, you already believe infrastructure belongs in a real programming language. Netherframe shares that philosophy—with a tree diff CLI, an automation SDK, and Python-native loops and testing—while taking a fundamentally different architecture underneath:

  • Native Terraform provider binaries directly over gRPC — no Pulumi bridge lag; run nf generate providers against any provider on the Terraform Registry or your internal mirror immediately.
  • Safety built into the run lifecycle — automatic recovery_strategy="ROLLBACK", managed & verified teardown retention (LifecycleRules(retain=...) + @retained_check), crash-resumable finalizers (nf state verify), and tamper-evident saved plans.
  • No external control plane required — store state in local files, S3/GCS/Azure/Consul, or PostgreSQL graph state with concurrent applies across one app.

Side-by-side: Pulumi (Python) vs. Netherframe

import pulumi
import pulumi_aws as aws

config = pulumi.Config()
env = config.get("env") or "dev"

bucket = aws.s3.Bucket(
    "logs",
    bucket_prefix=f"acme-{env}-",
    opts=pulumi.ResourceOptions(retain_on_delete=True),
)

policy_arn = bucket.arn.apply(lambda arn: f"{arn}/*")
pulumi.export("bucket_id", bucket.id)
pulumi.export("objects_arn", policy_arn)
# coding: nf_autoid

from typing import Literal

from nf.core import App, Bind, BindContext, LifecycleRules, Output, Stack
from nf.providers.hashicorp.aws import AwsProvider, S3Bucket


def logging(env: Literal["dev", "prod"] = "dev", region: str = "us-east-1") -> App:
    with App(nf_id="logging", recovery_strategy="ROLLBACK") as app, Stack(nf_id=f"logs-{env}"), BindContext:
        aws: Bind = AwsProvider(region=region)
        logs: Bind = S3Bucket(
            nf_provider=aws,
            bucket_prefix=f"acme-{env}-",
            lifecycle=LifecycleRules(retain="audit logs outlive teardown"),
        )
        bucket_id: Bind = Output(value=logs.output.id)
        objects_arn: Bind = Output(value=f"{logs.output.arn}/*")
    return app

Command and concept rosetta stone

Pulumi Netherframe equivalent Notes
pulumi preview nf plan --app <app> --diff --out plan.json Renders a Pulumi-style resource tree diff and saves a SHA-256 verified immutable plan artifact.
pulumi up nf apply --app <app> --plan-file plan.json (or nf deploy) Applies the exact reviewed plan; refuses stale state, changed inputs, or removed checks.
pulumi destroy nf destroy --app <app> Rebuilds with the last apply's recorded deployment inputs automatically.
pulumi refresh Built into nf plan (default --refresh=true) Plans refresh live state before diffing; nf drift also audits and patches source code.
pulumi import / ResourceOptions(import_=...) .import_from(...), LifecycleRules(adopt=...), or --adopt-from Reviewed import plan action; supports runtime import_from(parent.output.id) in one apply.
Output[T].apply(fn) RuntimeValue expressions, f-strings, and @hybrid_runtime F-strings and operators work natively; use @hybrid_runtime for arbitrary Python evaluated during apply.
pulumi.Config / Pulumi.<stack>.yaml App factory parameters (++env=prod, ++@prod.toml) Type-checked against Python annotations (Literal, dataclass, Secret[T]); nf vars lists resolved values.
ResourceOptions(protect=True) LifecycleRules(prevent_destroy=True) Blocks delete and replacement at plan time and refuses nf destroy.
ResourceOptions(retain_on_delete=True) LifecycleRules(retain="why") + @retained_check Key difference: Pulumi ejects retained resources from state; Netherframe keeps them managed in state, protects their dependencies, and verifies them via provider reads + checks.
CrossGuard (Policy as Code) @app.check(phase=...) + nf lint (netherframe.lint.hashicorp.aws) Plain Python checks run at prerequisites, plan, apply (under the lock), and finalize.
Pulumi Automation API nf.sdk.Project / AsyncProject Every nf command as a typed Python method, context-scoped without os.chdir().
pulumi stack / Pulumi Cloud [tool.nf].apps + S3/GCS/Azure/PostgreSQL backend One app can hold multiple stacks; PostgreSQL graph state supports concurrent applies on one app.

Key differences you will notice quickly

  1. Saved plans are first-class and strict: Unlike Pulumi's update plans (optional and preview-scoped), nf plan --out → nf apply --plan-file is the standard production workflow, checking content digest, state serial/lineage, provider fingerprints, inputs, and declared app checks.
  2. Rollback on failure (recovery_strategy="ROLLBACK"): When a later resource or @post_apply_check fails, Netherframe automatically deletes resources created earlier in that apply instead of leaving partial changes behind.
  3. Crash-proof finalizers (phase="finalize"): If a CI runner is killed with kill -9 mid-apply, the run record remains running beside state until nf state verify runs your finalizers under the lock and flags unrecorded mutations as unknown.
  4. No secret leakage on CLI argv: Secret[T] factory parameters refuse command-line flags outright; supply them via ++@<(...) or nf.sdk.Project(inputs=...).
  5. Interactive terminal UI (nf tui): Inspect state, attribute diffs, live runs, and dependency graphs (:graph) directly in your terminal.

Migrating resources from Pulumi

  1. Export the physical cloud IDs of resources managed by your Pulumi stack (pulumi stack export).
  2. Model those resources in Netherframe using .import_from(id) or an --adopt-from manifest ({"network.aws_vpc.main": {"import_id": "vpc-..."}}).
  3. Run nf plan --app <app> --diff --adopt-missing error --out import.plan.json, verify every resource imports cleanly with no unwanted replacements, and apply.
  4. Remove the migrated resources from Pulumi state without deleting the cloud objects (pulumi state delete --force <urn> or retain_on_delete=True).

Next steps