I’m taking a look at creating a deployment via the...
# automation-api
I’m taking a look at creating a deployment via the rest api. It mentions a stack must exist prior to creating the deployment. Reasonable. However, looking at the regular rest api for stacks, I do not see any way to create a stack via the rest api. Is this actually the case? So even using the deployment api would still require wrapping the cli to create a stack?
Ah, that is a gap in our documentation. There is indeed a REST API for creating a stack it is just missing from the docs. I opened a bug so we can backfill the docs. In the meantime, the API is:
Copy code
POST /api/stacks/{organization}/{project}
And here are the types for the payload: https://github.com/pulumi/pulumi/blob/master/sdk/go/common/apitype/stacks.go#L45-L54 A post body along these lines is the minimum:
Copy code
  "stackName": "yourStackName"
Ooo lemme try. Thank you!!
Booyah - it worked