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
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/
:thank-you: 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
#python
Join Slack