pulumi/pulumi · error · ResourceError

Resource name is not available, this resource instance must

Error message

Resource name is not available, this resource instance must have been constructed by an old SDK

What it means

The SDK records the constructor-time name on each resource instance in the internal __name field. resourceName() throws this error when that field is undefined, which can only happen if the instance was created by an SDK version that predates this field. It guards against silent misbehavior when engine callbacks inspect resources from an old SDK.

Source

Thrown at sdk/nodejs/resource.ts:1912

    if (parts.length === 3) {
        return parts[0];
    }
    return undefined;
}

/**
 * The Pulumi type assigned to the resource at construction, of the form `package:module:name`.
 */
export function resourceType(res: Resource): string {
    return res.__pulumiType;
}

/**
 * The Pulumi name assigned to the resource at construction, i.e. the "name" in its constructor call.
 */
export function resourceName(res: Resource): string {
    if (res.__name === undefined) {
        throw new ResourceError(
            "Resource name is not available, this resource instance must have been constructed by an old SDK",
            res,
        );
    }
    return res.__name;
}

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Upgrade the dependency package that constructs the resource to use a current @pulumi/pulumi version
  2. Deduplicate @pulumi/pulumi with 'npm ls @pulumi/pulumi' and resolve so only one version is installed
  3. Re-run 'npm install' / lockfile update so the provider code and runtime share the same SDK
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof (res as any).__name === "undefined") { throw new Error("resource built by old SDK"); }

Type guard

function hasResourceName(res: pulumi.Resource): res is pulumi.Resource & { __name: string } { return typeof (res as any).__name === "string"; }

Prevention

When it happens

Trigger: Mixing SDK versions in one program (e.g. a dependency library constructing resources with an old @pulumi/pulumi while the runtime uses a newer one), so resourceName() is called on an instance lacking __name.

Common situations: Stale node_modules with duplicate @pulumi/pulumi copies at different versions; a provider SDK package pinning an ancient @pulumi/pulumi dependency; partially upgraded monorepos.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/494b2cb07e975818. Report an issue: GitHub.