https://pulumi.com logo
#python
Title
# python
q

quick-wolf-8403

06/14/2022, 2:32 AM
Possibly dumb question: I'm adding Pulumi to a co-worker's Flask-based API. Would it be appropriate to put Automation API stuff in the module's dunder init file?
__init__.py
g

great-queen-39697

06/14/2022, 2:34 PM
Not a dumb question at all. You certainly can put it in there, but is that where the rest of the API is located? Generally, I like to put it either in its own file that I then call as a module or embed it in the code directly. Here's some examples that might help as you're thinking through what you want where: ā€¢ https://github.com/pulumi/automation-api-examples/tree/main/python/pulumi_over_http ā€¢ https://github.com/komalali/self-service-platyform ā€¢ https://www.pulumi.com/learn/embedding-pulumi/building-api/
šŸ™ 1
q

quick-wolf-8403

06/15/2022, 4:51 PM
I see your point--and I guess this is more of a Python modules standard practices question than an Automation API question. I appreciate the examples!
šŸ‘ 1
2 Views