enough-kite-69616
06/23/2020, 9:32 PM@pulumi\postgresql
package. How do I tie the roles and schemas to the server I create?gentle-diamond-70147
06/24/2020, 6:49 PMimport * as azure from "@pulumi/azure";
import * as pg from "@pulumi/postgresql";
const resourceGroup = new azure.core.ResourceGroup("resourceGroup");
const server = new azure.sql.SqlServer("main",{});
const db = new azure.sql.Database("main",{});
const pgProvider = new pg.Provider("main",{
username: server.administratorLogin,
password: server.administratorLoginPassword,
host: db.serverName,
});
const pgRole = new pg.Role("main",{
// role args
}, {provider: pgProvider})
(pseudocode)pg.Provider
in this case) and then pass it into the PostgreSQL specific resources in order to tie it to the specific server that you created.enough-kite-69616
06/24/2020, 6:57 PMazure:sql:Database (ground-control-db):
error: Error issuing create/update request for SQL Database "ground-control-db" (Resource Group "RD-FoundationalServices-rg", Server "ground-control-db-server"): sql.DatabasesClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="ParentResourceNotFound" Message="Can not perform requested operation on nested resource. Parent resource 'ground-control-db-server' not found."
const server = new azure.postgresql.Server(name, {
name: name + '-server',
location: resourceGroup.location,
resourceGroupName: resourceGroup.name,
administratorLogin: "psqladmin",
administratorLoginPassword: adminPassword,
skuName: "GP_Gen5_4",
version: "11",
sslEnforcement: `Enabled`,
storageProfile: {
storageMb: 5120,
backupRetentionDays: 7,
autoGrow: 'Enabled',
},
tags: {
"project": "mercury"
}
});
const db = new azure.sql.Database(name,{
name: name,
resourceGroupName: resourceGroup.name,
serverName: server.name,
}, {
dependsOn: server
});
gentle-diamond-70147
06/25/2020, 6:23 PMlocation
on the Database
too. Maybe the "not found" error is because it's trying to reference the Server from a different region.up
, does it succeed or same error?enough-kite-69616
06/25/2020, 7:59 PM