This message was deleted.
# aws
s
This message was deleted.
b
Typically the way I’ve seen this done (e.g. with a normal Aurora cluster, which I don’t think is different in this regard) is one of two ways: 1. Use the Automation API to run your stack to create the username in Aurora (you’d do this using the Postgres provider) 2. Create the Aurora cluster in one project/stack, and reference it in another stack and create the user there. That said, typing this out, is there a reason you can’t just use the Postgres provider (or MySQL or whatever it is you’re using with Aurora) and construct it with the Aurora details?
c
I tried doing that but I ran into this error which made me think I was going in the wrong direction. I’ll try the suggested fix in that thread (although that’s for terraform and may be difficult to apply to Pulumi).
b
What does the code roughly look like
c
Copy code
const role = new postgres.Role("role", {
    login: true,
    name: "role",
    password: 'password'
})
  
const grant = new postgres.Grant("halo-application-grant", {
    database: theCluster.databaseName,
    objectType: "database",
    privileges: ["SELECT", "INSERT", "UPDATE", "DELETE"],
    role: role.name,
})
that’s what’s causing the error, I’m looking at how to set the provider option
superuser = false
as suggested
ok, making progress on this. I added
postgresql:superuser: false
to the stack config. But the serverless cluster takes a minute to warm up, so I still doubt I can run this without a delay or loop of some sort.
ok, got that working, thanks.
b
Cool. I think generally Pulumi knows to wait until the cluster is done