fast-yacht-78432
09/07/2023, 8:00 PMLocalWorkspace.createStack()
returns the promise of a Stack
whereas if I make an instance of `LocalWorkspace`:
const workspace = LocalWorkspace.create({ /* ... */ });
workspace.createStack("somestackname")
here returns void
?
I was going to try a factory that dispensed workpsaces, but I'm wondering if this idea that I produce workspace instances is me misunderstanding the automation api fundamentals. If there is an example of using an instance of a localworkspace as opposed to just that classes static methods for creating at stack and returning information about it I would appreciate itawait workspace.createStack(stackName);
await workspace.selectStack(stackName);
const stack = await workspace.stack();
I'm able to create a stack, select it, and get a summary about it if it is an instance but I don't see how to effect the state of it to do a stack up or downfull-eve-52536
09/07/2023, 8:46 PMawait workspace.stack()
returns a StackSummary typeconst stack = await LocalWorkspace.createOrSelectStack(localProgramArgs, workspaceArgs);
would return a Stack typefast-yacht-78432
09/07/2023, 8:53 PM.up()
with it, or is this only available using the static methods LocalWorkspace
full-eve-52536
09/07/2023, 8:57 PMup()
method exists on the Stack
type objects. So something like this should work:
const stack = await workspace.selectStack(stackName);
await stack.up();
fast-yacht-78432
09/07/2023, 9:00 PM.selectStack
returns a void
with typescriptawait
all your operations but don't expect a responsefull-eve-52536
09/07/2023, 9:02 PMworkspace
as WorkspaceArgs
. I.e:
const workspaceArgs: LocalWorkspaceOptions = {
workDir: infraDir,
envVars: {
PULUMI_K8S_ENABLE_PATCH_FORCE: 'true',
NODE_OPTIONS: '',
},
};
fast-yacht-78432
09/07/2023, 9:03 PMasync
and hit a callback