https://pulumi.com logo
#automation-api
Title
# automation-api
f

fancy-shoe-29676

12/14/2020, 7:45 PM
Copy code
const projectName = "project"

    const args: InlineProgramArgs = {
        stackName: "dev",
        projectName: projectName,
        program: pulumiProgram
    };

    const projectSetting: ProjectSettings = {
        name: projectName,
        runtime: "nodejs",
        backend: {
            url: "<s3://pulumi-states>"
        }
    }

    const stackSettings: StackSettings = {
        secretsProvider: "<awskms://alias/pulumi?region=eu-central-1>"
    }

    const opts: LocalWorkspaceOptions = {
        projectSettings:  projectSetting,
        stackSettings: {
            "dev": stackSettings
        },
        secretsProvider: "<awskms://alias/pulumi?region=eu-central-1>"
    }

    // create (or select if one already exists) a stack that uses our inline program
    const stack = await LocalWorkspace.createOrSelectStack(args, opts);
f

freezing-finland-22895

12/14/2020, 9:03 PM
I had to add
workDir: "."
to my
mLocalWorkspaceOptions
value to get some stuff working - maybe that will fix your problem:
Copy code
const opts: LocalWorkspaceOptions = {
        projectSettings:  projectSetting,
        stackSettings: {
            "dev": stackSettings
        },
        workDir: ".",
        secretsProvider: "<awskms://alias/pulumi?region=eu-central-1>"
    }
just a guess ....
f

fancy-shoe-29676

12/15/2020, 4:53 AM
hi, thx, it solves the problem on my local machine - but in the ci pipeline it happens again because the working directory is empty every time
f

freezing-finland-22895

12/15/2020, 4:54 AM
Maybe refresh config if the stack exists? Just guessing and not quite sure how to do that 😉
4 Views