Channels
welcome
pulumi-cdk
cloudengineering
yaml
blog-posts
localstack
pulumi-ai
package-authoring
general
pulumiup-booth-support
oracle-cloud-infrastructure
learn-pulumi-events
linen
registry
built-with-pulumi
pulumi-cloud
contribex
testingtesting321
hacktoberfest
pulumi-crosscode
content-share
finops
multi-language-hackathon
office-hours
workshops
gitlab
pulumi-kubernetes-operator
jobs
pulumi-deployments
dotnet
aws
golang
announcements
java
pulumiverse
python
install
getting-started
cloudengineering-support
testingtesting123
hackathon-03-19-2020
typescript
google-cloud
contribute
azure
kubernetes
docs
automation-api
status
Powered by
#general
Title
g
gray-elephant-37695
04/16/2019, 8:44 AM
Are there library versions of pulumi's CLI, I'd like to be able to spin up and tear down some infra as part of some tests it would be nice if the tests could call pulumi up and destroy themeselves?
s
shy-army-45455
04/16/2019, 9:03 AM
Not sure if there's a public safe to use API/SDK available, but you could always mimic what the CLI source does:
https://github.com/pulumi/pulumi/blob/master/cmd/up.go
👍 1
(Assuming you're writing in Go and willing to live on the wild side)
g
gentle-diamond-70147
04/16/2019, 2:47 PM
We have some work coming soon that will make this easier (
https://github.com/pulumi/pulumi/issues/2287
), but for now you can do more-or-less how we do this with a Go test harness -
https://github.com/pulumi/pulumi/blob/master/examples/examples_test.go
.
Post