Hello everyone, After solving my Routing and other...
# python
s
Hello everyone, After solving my Routing and other funny issues I have created an AWS Redshift instance and now I want to create users and grants in this cluster.
Copy code
redshift_cluster = aws.redshift.cluster(..)

pg_provider = postgresql.Provider('redshift_cluster',
    database=redshift_cluster.database_name,
    host=redshift_cluster.dns_name,
    port=redshift_cluster.port,
    username=redshift_cluster.master_username,
    password=redshift_cluster.master_password)

my_user = postgresql.Role('my_user',
    name="my_user",
    password="123456",
    login=True,
    create_database=False,
    create_role=False,
    superuser=False,
    opts=pulumi.ResourceOptions(provider=pg_provider)
But, when I try to apply this code it will fail with an SQL error:
Copy code
error: error creating role my_user: pq: syntax error at or near "ROLE"
Any ideas what is wrong with my Role() definition?
e
Redshift does not speak the Postgres dialect precisely, there’re differences especially around things like roles. I.e. they both support CREATE USER but only Postgres supports CREATE ROLE
s
And as the Pulumi PostgreSQL provider only has a Role Resource it won't be able to create a Role within a Redshift derivate of PostgreSQL
I see
Do you have plans for adding the User aswell?
Am not too familiar with PostgreSQL, but User was the old concept, Roles are the new way to go?
What about adding a Script resource to the provider for raw SQL scripts to execute, this could help in cases of feature incompatibilities like mine
e
I’m not too familiar with this part of the codebase yet, but it sounds like if things like this are missing https://github.com/pulumi/pulumi-postgresql/issues adding requests to issue tracker can be very helpful
👍 1
s
Awesome, will add a feature request. Thanks for your help
👍 1