This message was deleted.
# python
s
This message was deleted.
s
How are you configuring the postgres provider? In order to use that provider, your database has to be reachable over the network. (The provider is executing on your local machine and has to be able to connect to the DB, which is provisioned in Google Cloud.)
I should also note that you generally do not want your database to be addressable over the internet for production environments (and maybe any environment). Instead, you should use a VPN.
b
can you elaborate on what the provider is? my database is reachable in GCP and I can use my postgres (superuser) in the connection str to connect to the my app to the database.
s
Where is the app running: locally or in GCP?
b
in gcp with cloudrun service
s
Right, so when you run Pulumi on your local machine, it probably can't reach the database over the network unless you've configured your DB to be reachable over the internet.
b
yea that makes sense. How would you then suggest i create a user that can be used in my connection str with pulumi? Is it even possible yet?
s
There's a few ways you can solve this: You can make another CloudRun container that runs your DB migrations either using Pulumi (the automation API would probably be a good fit) or using a tool like Flyway or Django migrations. You've already established connectivity, so this is probably easiest. You can establish a VPN connection to run your migrations from your machine.
In a production scenario, you would run your DB migrations (including creating that first app user, tables, views, etc.) as part of your CI/CD pipeline.
b
alright! Thank you very much for the applies and suggest solutions to fix my problem.
s
You're welcome! Good luck!
121 Views