a

    ancient-car-89914

    2 months ago
    I’m finding myself in the position of having to split a monolithic pulumi project into multiple sub-projects, and there are a lot of secrets in the config - is there some way to copy them from one project to another the way you can with stacks?
    in case anyone else needs to do this, I tried-and-failed my way into finding a working solution:
    pulumi config cp -C [directory of original project] -s [fully qualified stack name in original project] -d [fully qualified stack name in new project]
    (fully qualified stack name being
    org/project/stack
    )
    this will overwrite the stack’s config file in the original project with a new version which has been encrypted for the new project/stack, which you can copy to the new project directory and then git checkout to revert the original config file
    seems a slightly weird/backward way of doing it, but nothing else I tried worked
    update: seems like the above command will leave your new project using the secrets provider from the old project, which seems like a bad idea and actually caused an issue for me when I later renamed the new project - looks like this can be fixed/avoided by running this immediately after copying the config:
    pulumi stack change-secrets-provider default