n

    nice-beard-3866

    8 months ago
    Hey, I'm having an issue where pulumi overwrites the stack config file on each run (
    Pulumi.production.yaml
    ) it sorts all the keys and removes all comments and whitespace. Is there some way to prevent it from doing this? I have a bunch of comments and logical grouping/ordering that I don't want to get lost
    m

    millions-furniture-75402

    8 months ago
    I've never had Pulumi remove my comments. Are you using the automation API by chance?
    As far as I know, Pulumi stack configuration is tightly-coupled with these YAML files. To the point that the CLI and Automation API which wraps the CLI require them. https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/automation/localWorkspace.ts#L31-L43
    n

    nice-beard-3866

    8 months ago
    I'm not using the automation api directly, but the file is overwritten/reserialised on each pulumi preview or pulumi up - so I guess something could be going on with that automation api
    m

    millions-furniture-75402

    8 months ago
    We'd need to see more code to make a determination. The stripping on the comments in the Pulumi stack configurations is not something I've ever had happen.
    n

    nice-beard-3866

    8 months ago
    It seems I'm running into specifically this: https://github.com/pulumi/pulumi/issues/6848 Which would be addressed by this age old issue: https://github.com/pulumi/pulumi/issues/423