https://pulumi.com logo
Title
s

shy-dentist-79386

06/20/2022, 10:23 PM
Hi pulumi/postgresql needs to be able to connect to the database. But if I provision a db behind vpc without public accessibility (which is quite normal for db setup). what can I do for pulumi/postgresql to work??
l

little-cartoon-10569

06/20/2022, 10:32 PM
You've got a few options. For example, you can separate the DB configuration work into a separate project, and run that project from a bastion within a suitable subnet in the VPC.
Or you could use multiple projects within a single automation-api app: one of the projects includes setting up direct access from the deployment machine to the DB, and that project's stack would be destroyed within the automation-api app.
Or you move your DB configuration code out of Pulumi and into something that does have access to the DB, like an app VM or container.
s

shy-dentist-79386

06/20/2022, 10:37 PM
Thank you! I love the thrid one since I don’t need to change anything. 😁 got to set up a machine under the same vpc and run pulumi from it everytime.
l

little-cartoon-10569

06/20/2022, 10:39 PM
That'd be the 1st one, right?
If you currently set up the VPC and the DB from the same project, then you will definitely need to change something.
s

shy-dentist-79386

06/20/2022, 10:43 PM
Oh Yes, that is 1. DB is under the default vpc, so nothing need to change.
Thank you!
👍 1