Is there a way to create a project via Automation ...
# automation-api
Is there a way to create a project via Automation API? I might be missing something, but the examples seem to hardcode
. I’m working on a project to manage devops setup for clients and trying to create a new project/client.
So it looks something like:
Copy code
const stack = await auto.LocalWorkspace.createOrSelectStack({ workDir: dbWorkDir, stackName }, { name: "cool-project" });
🔥 1
OK great - I’ll try this thank you!
Wait this seems different from the REST API tutorial - does this still work for REST API use case?
"seems different"? Can you provide more details and the reference you're referring to? From memory, the REST API example should be routing a request to application code that uses the Pulumi automation API to run Pulumi commands, probably inside of Lambda.
If you're asking how to pass a parameter and remove line 12 from here: you want something like how stackName works:
Copy code
const projectName = req.body.project;
Copy code
$ curl --header "Content-Type: application/json"   --request POST   --data '{"id":"hello", "project": "my-project", "content":"hello world\n"}'   <http://localhost:1337/sites>