loud-gold-35289
08/31/2025, 5:10 AMloud-gold-35289
08/31/2025, 5:12 AMimport * as pulumi from "@pulumi/pulumi";
const myProvider: pulumi.dynamic.ResourceProvider = {
async create(inputs) {
return {
id: "foo",
outs: {
...inputs,
thiswontshowup: "this won't show up",
}
}
}
}
type MyResourceInputs = { thisworksfine: pulumi.Input<string> };
class MyResource extends pulumi.dynamic.Resource {
public readonly thiswontshowup!: pulumi.Output<string>;
constructor(name: string, props: MyResourceInputs, opts?: pulumi.CustomResourceOptions) {
super(myProvider, name, props, opts);
}
}
export const myResource = new MyResource("test", {
thisworksfine: "this works fine",
});
export const diditshowup = myResource.thiswontshowup ?? false;
pulumi preview Outputs section:
Outputs:
diditshowup: false
myResource : {
@isPulumiResource: true
id : [unknown]
thisworksfine : "this works fine"
urn : "urn:pulumi:dev::pulumi-dynamic-rip::pulumi-nodejs:dynamic:Resource::test"
}loud-gold-35289
08/31/2025, 5:20 AMpulumi.dynamic.Resource.little-cartoon-10569
08/31/2025, 10:48 PMComponent resources can define their own output properties. Outputs in a component must be registered with the Pulumi IaC engine by calling registerOutputs.https://www.pulumi.com/docs/iac/concepts/components/#registering-component-outputs
loud-gold-35289
08/31/2025, 10:51 PMthis.registerOutputs doesn't even exist. I'm also not sure what the value would be set to since that comes from the dynamic provider.little-cartoon-10569
08/31/2025, 10:53 PMloud-gold-35289
08/31/2025, 10:58 PMpulumi.ComponentResource https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/classes/ComponentResource.html#registerOutputs which is not in the inheritance hierarchy for pulumi.dynamic.Resource. pulumi.dynamic.Resource inherits from pulumi.CustomResource which does not have that method. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/classes/CustomResource.htmllittle-cartoon-10569
08/31/2025, 11:00 PMloud-gold-35289
08/31/2025, 11:07 PMlively-crayon-44649
09/01/2025, 8:45 AMlively-crayon-44649
09/01/2025, 8:46 AMfoo, you do something like this.foo = undefined in the constructorlively-crayon-44649
09/01/2025, 8:46 AMlively-crayon-44649
09/01/2025, 8:46 AMlively-crayon-44649
09/01/2025, 8:47 AMloud-gold-35289
09/01/2025, 3:44 PMthis.foo = undefined didn't do it so I guess it only looks at the props passed to the constructor somehow.