https://pulumi.com logo
Title
g

green-daybreak-91402

01/17/2023, 7:28 PM
Hey, I am using the PostgreSQL provider to run some commands for our RDS instance. How can one wait for the RDS instance to be ready before using the postgresql provider?
b

billowy-army-68599

01/17/2023, 7:29 PM
this should happen automatically if you provide outputs from the rds instance to the postgres provider. Is this not happening? if not, can you share code and any errors?
g

green-daybreak-91402

01/17/2023, 7:31 PM
Im getting a connection refused error. but it may be because there is an existing database and the postgres provider uses new resources
b

billowy-army-68599

01/17/2023, 7:33 PM
is your RDS in a private subnet? can you access it with netcat or telnet?
g

green-daybreak-91402

01/17/2023, 7:34 PM
yes it is private and I can acces it using a bastion. I think the issue is that the new posgresql commands is using a newly generated password and not the one already provisioned.
hey @billowy-army-68599, I am getting this error when the postgres provider attempts to run the different resources:
error detecting capabilities: error PostgreSQL version: pq: SSL is not enabled on the server
this is how I am setting up my provider:
const pgsqlProvider = new postgresql.Provider(
      `${parentId}-db-pgsql-provider`,
      {
        host: db.instance.endpoint,
        password: this.password,
        sslmode: 'disable',
        username: this.username,
      },
    );
b

billowy-army-68599

01/17/2023, 11:14 PM
i think it’s
sslMode
note the caps
oh wait no that’s deprecated
i’m not sure I’m afraid
g

green-daybreak-91402

01/18/2023, 12:48 AM
😞 awww, ok Ill keep tsearching/trying
do commands wiht the postgresql provider run in sequential order as they are defined? or is it necesary to use
dependsOn
to ensure they run in a specific order?
hmm does the provider run inside the VPC? im getting this error now:
dial tcp 10.0.253.222:5432: connect: operation timed out
not sure if its networking related or permissions
b

billowy-army-68599

01/18/2023, 4:37 AM
do commands wiht the postgresql provider run in sequential order as they are defined? or is it necesary to use dependsOn to ensure they run in a specific order?
you can use dependsOn, but if you pass an output from one resource (ie, the db address or username) as an input to another resource (ie: the provider) the engine figures out the correct order
hmm does the provider run inside the VPC?
no it runs from the machine you’re running Pulumi on
it looks like your bastion isnt working correctly, it still seems like a network problem to me
g

green-daybreak-91402

01/18/2023, 6:04 AM
aaah! thats it! I was thinking this ran remotely somehow inside the aws env. I turned on teh bastion and its connecting! Thanks for clearing that up!