https://pulumi.com logo
#general
Title
# general
a

able-zoo-58396

04/14/2020, 11:02 PM
Hello. I'm trying to determine the best way to dynamically spin up and tear down infrastructure from my app backend. The Pulumi Team Pro plan says it includes access to APIs and Webhooks. Does anyone know where I can find the docs for that API?
w

white-balloon-205

04/14/2020, 11:36 PM
determine the best way to dynamically spin up and tear down infrastructure from my app backend
In general you will want to do this by scripting the
pulumi
CLI. Deployments with Pulumi happen in a compute context you manage (local machine, CI machine, or some sort of agent you use in a deployment service). The Pulumi service backend does not (currently) do deployments for you (and thus does not need your cloud credentials, etc.). We are discussing approaches to providing a more integrated API instead of requiring scripting the
pulumi
CLI - but generally the same things would be possible. See https://github.com/pulumi/pulumi/issues/3901.
The Pulumi Team Pro plan says it includes access to APIs and Webhooks. Does anyone know where I can find the docs for that API?
These REST APIs are not yet publically documented, but we are happy to work with customers who are interested in using them to work with the existing APIs used by the
pulumi
CLI to coordinate with the Pulumi backednd service. As noted above though - these APIs do not yet today support triggering deployments that run in the Pulumi backend. You instead run the
pulumi
CLI yourself in the context where you want to do the deployment. Note that many of the largest Pulumi users I've worked with are doing the same thing - dynamically managing infrastructure via programmatic services backed by Pulumi - so this is very much a supported style of usage.
a

able-zoo-58396

04/14/2020, 11:54 PM
Thanks, @white-balloon-205. So is the general pattern to create a secured hosted instance (EC2, etc) that has the Pulumi CLI installed and authenticated, and then scripts can tell that server to execute the Pulumi commands? I assume that server then listens to the webhooks from the Team Pro plan to determine the status of the builds.
w

white-balloon-205

04/15/2020, 1:15 AM
Yep - that’s the general pattern we see. Or a light http api that coordinates Jobs in a CI/CD system.