1

I want to invoke execute_statement API of Redshift Serverless with a create user statement like CREATE USER "john" PASSWORD 'johnDoe1';. However, when I do this via Python script (or AWSCustomResource in CDK), I get

must be superuser or have CREATE USER system privilege to create users

And when I try to use my admin credentials by using DbUser like below, I get

DB User cannot be set during a serverless request.`

response = client.execute_statement(
        WorkgroupName='emr-workgroup',
        Database='dev',
        DbUser='admin',
        Sql=sql
    )

How can I automate this without having to go manually to the query console and execute these queries? How an IAM role can be a superuser so that I can execute such queries in an automated way?

2
  • hey @shiva did you get anywhere with this? I'd love to use CDK to create users/groups in Redshift Serverless, but there don't seem to be any constructs to do so.... only for Redshift standard: constructs.dev/packages/@aws-cdk/aws-redshift-alpha/v/… Commented Nov 26 at 6:48
  • Sadly this is not possible currently so I had to do this manually Commented Nov 26 at 17:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.