better-actor-92669
02/20/2020, 9:40 AMpulumi-gcp
module to create a CloudSQL DB Instance https://github.com/pulumi/pulumi-gcp/blob/master/sdk/python/pulumi_gcp/sql/database_instance.py. Since pulumi-postgresql
connects to an instance similarly to pgsql, I define PGHOST
, PGUSER
, and PGPASSWORD
during Pulumi runtime. Since the CloudSQL Instance is created via the same execution, I define dependencies like:
opts=ResourceOptions(
depends_on=[cloud_pgsql_main_1],
),
Nevertheless, it doesn't seem to work as it tries to connect to the instance immediately, however the instance is obviously not ready, and pulumi up
fails. Do you think it is possible that two separate modules pulumi-gcp
and pulumi-postgresql
do not appropriately share dependencies during runtime?limited-rainbow-51650
02/20/2020, 9:47 AMpostgresql.Provider
after the CloudSQL instance creation and create the roles passing the provider to it. Because of this chaining, it will wait correctly:
const dbServerResource = new ... // CloudSQL creation here
const databaseProvider = new postgresql.Provider("adminconnection", {
username: dbAdminUser,
password: dbAdminPassword,
superuser: false,
host: dbServerResource.fqdn,
port: 5432
})
const databaseRole = new postgresql.Role("your_role", {
connectionLimit: 4,
login: true,
name: "your_role_name",
password: dbRolePassword
},
{
provider: databaseProvider
})
limited-rainbow-51650
02/20/2020, 9:49 AMbetter-actor-92669
02/20/2020, 9:51 AMpulumi_postgresql.Provider
class in the postgresq l module.better-actor-92669
02/27/2020, 9:14 AMlimited-rainbow-51650
02/27/2020, 2:09 PMbetter-actor-92669
02/27/2020, 2:11 PMlimited-rainbow-51650
02/27/2020, 2:12 PMbetter-actor-92669
02/27/2020, 2:13 PMbetter-actor-92669
02/27/2020, 2:14 PMlimited-rainbow-51650
02/27/2020, 2:17 PMpulumi-postgresql
provider Github repo for further investigation. At runtime, you should be able to set all properties on a newly created Provider object. If that is not available, an issue is your means to communicate your desire. 😉better-actor-92669
02/27/2020, 2:21 PM