I would like to write command line tooling to do w...
# azure
v
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
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
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
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
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.