This message was deleted.
# typescript
s
This message was deleted.
k
Diffs themselves show no actual changes to class attributes, so I'm guessing there is some other part of ComponentResource that is changing that it doesn't show
l
That's not something Are the exported properties Outputs? Or just primitives?
k
Mix of pulumi.output<strings> and strings
l
Nothing is occurring. Can you create a snippet example?
k
Copy code
~ firebaseComponent    : {
        firebaseDatabaseName: "removed"
        firebaseDatabaseUrl : "removed"
        urn                 : "removed"
    }
Output diff looks something like this
With no actual planned changes
l
Can you show how those properties are set, and how the exports are done? You can use the Text Snippet feature in the + menu
k
export (cut off the inputs):
export const firebaseComponent = new FirebaseComponent('firebase', {
class definition
Copy code
export class FirebaseComponent extends pulumi.ComponentResource {
    public readonly firebaseDatabaseUrl: pulumi.Output<string>;
    public readonly firebaseDatabaseName: pulumi.Output<string>;

    constructor(name: string, props: FirebaseInterface, opts?: pulumi.ComponentResourceOptions) {

....

        const firebaseDatabase = new GoogleFirebaseInstanceResource(firebaseDatabaseName, {
            gcpProjectNumber: props.projectNumber,
            location: props.firebaseRegion,
            databaseId: firebaseDatabaseName,
        }, {
            parent: this,
            dependsOn: [firebaseProject],
        });

        this.firebaseDatabaseName = firebaseDatabase.id;
l
Ah. You're exporting an object, not a primitive / output. That's the expected result.
Export just the properties you want exported, and it'll hide them when they don't change.
k
so I'd need to make a new object of the attributes of the class instead of just exporting the class object?
l
No. Exporting a class does nothing from Pulumi's point of view. Only data (objects / primitives / outputs) are relevant.
If it's feasible, you should consider exporting only the properties.
Like this:
Copy code
const firebaseComponent = new FirebaseComponent( ...);
eporrt const firebaseDatabaseUrl = firebaseComponent.firebaseDatabaseUrl;
k
we've got downstream stacks already depending on the attributes (
firebaseComponent.firebaseDatabaseName
for example) so in order to not break functionality I'd have to still make an object, but understood
thanks
l
You can create the object on the other side. You can export the values individually.
That said, you can export the object as-is, there is no non-cosmetic downside.
In one of the projects I work on, every stack exports only a single object. All the relevant properties of all the resources are grouped into a single exported object. It's weird, and I don't recommend it, but it works.
k
Yeah was just hoping to find something like an ignoreChanges I could use to ignore whatever hidden attribute is changing, but I'll just make new ones to export so we don't have to change downstream too
l
You could try ignoreChanges. It's an opt.
I don't think it'll do anything for exports.
k
makes sense
well I've got a workaround that should work, appreciate the help
👍 1
will stick to single string outputs going forward 🙂
113 Views