08/15/2021, 5:35 PM
Hi,raised the question earlier but didnt get the reply, we have api which create project and stack and creates the pulumi project folder on the specified location using automation api . however when we try to deploy any service ie ec2,s3 on specific project/stack it gives error,
unable to find the stack
. Just would like to confirm if we are using the right function to select the existing stack .Below is the the code , workDir is the absolute path there the project directory is created . We have tried giving different ways with no luck
Copy code
workDir := "./projects"	fmt.Println("workDir",workDir)

s, err := auto.SelectStackInlineSource(ctx, projvls.Stackname, projvls.Projectname , program,  auto.PulumiHome(workDir), envvars)	if err != nil {
we have also tried to use following function as well but unable to locate the stack
Copy code
// WorkDir is the directory to execute commands from and store state.
func WorkDir(workDir string) LocalWorkspaceOption {
	return localWorkspaceOption(func(lo *localWorkspaceOptions) {
		lo.WorkDir = workDir


08/15/2021, 10:22 PM
How are you setting the Pulumi backend?


08/16/2021, 8:58 AM
For backend we have tried with both local and our own s3 bucket. Backend is also set using autimation api at the time of project creation


08/16/2021, 11:55 AM
Yes, are you setting it with an environment variable? Or in project settings? Can you show full code?