limited-rainbow-51650
03/01/2021, 8:52 AMpulumi-up
is not in the same VPC as the DB setup, so we want to integrate cloud_sql_proxy
in our code setup. Starting the proxy via NodeJS child_process
works, but we are searching the correct place in our code to stop the proxy after the mysql.Grant
resources have been created/updated:
const ddl = new mysql.Grant(
config.dbDDLUsername,
{
user: DDLUser.name,
database: database.name,
privileges: ["CREATE", "ALTER", "DROP"],
host: "%",
},
{
provider: mysqlProvider
}
);
const dml = new mysql.Grant(
config.dbDMLUsername,
{
user: DMLUser.name,
database: database.name,
privileges: ["UPDATE", "INSERT", "SELECT", "INDEX", "DELETE"],
host: "%",
},
{
provider: mysqlProvider
}
);
pulumi.all([ddl.id, dml.id]).apply(async () => {
console.log(`>>>>> Killing cloud_sql_proxy... <<<<<`);
sqlProxyProcess.kill();
});
Pulumi is hanging now and is not killing the child process. Any ideas?