https://pulumi.com logo
Title
a

ambitious-alligator-62127

02/16/2023, 8:55 PM
Hello, when using Azure postgres db, anyone know how I would go about replicating this in Pulumi?
GRANT azure_pg_admin TO <new_user>;
i

icy-doctor-13719

02/16/2023, 9:04 PM
Are you on Single or Flexible server?
Pulumi.AzureNative.DBforPostgreSQL.ServerAdministrator
I know there is this one for SingleServer
a

ambitious-alligator-62127

02/17/2023, 2:49 AM
Found it.
postgresql.GrantRole("grant role azure_pg_admin",
                     grant_role="azure_pg_admin",
                     role=role.name,
                     opts=ResourceOptions(
                         provider=pg_provider
                     )
                     )
i

incalculable-napkin-4298

02/17/2023, 2:47 PM
If i'm not mistaken, this approach only works if your server is connected to the internet. If your postgres server (flexible in my case) is only accessable within a vpc, then you can't use the pulumi postgresql library.