Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
package-authoring
pulumi-ai
pulumi-cdk
pulumi-cloud
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by
Title
v
victorious-exabyte-70545
09/21/2021, 4:47 PM
I would like to write command line tooling to do what the pulumi cli does. Specifically the up functionality but with checks in place. Can someone point me to the python documentation on how to accomplish this? Thanks much!
b
billowy-army-68599
09/21/2021, 4:52 PM
you're looking for the automation api!
https://www.pulumi.com/automation/
There are some examples here:
https://github.com/pulumi/automation-api-examples/tree/main/python
v
victorious-exabyte-70545
09/21/2021, 5:23 PM
This is it! Thanks!
can you point me to the code for the equivalent of pulumi login?
It looks like this is updated: ~/.pulumi/credentials.json
when running pulumi login
b
billowy-army-68599
09/22/2021, 12:24 AM
hi there! it's not currently implemented in the automation API itself, but you should be able to achieve the same result using os.SubProcess:
https://docs.python.org/3/library/subprocess.html
v
victorious-exabyte-70545
09/22/2021, 12:34 AM
yah. it also looks like I can just generate ~/.pulumi/credentials.json with current pointed to my project.
I can write a context manager to generate and then remove on completion of pulumi action.
3 Views
#azure
Join Slack