brainly/terraform-provider-redshift

Add support for GRANT CREATE MODEL / GRANT EXECUTE ON MODEL

Opened this issue · 2 comments

Hello!

I would like to use Redshift provider to grant privileges for in-database machine learning.

GRANT CREATE MODEL
    TO { username [ WITH GRANT OPTION ] | ROLE role_name | GROUP group_name | PUBLIC } [, ...]

GRANT { EXECUTE | ALL [ PRIVILEGES ] }
    ON MODEL model_name [, ...]

    TO { username [ WITH GRANT OPTION ] | ROLE role_name | GROUP group_name | PUBLIC } [, ...]

If there is no time for this can you please give some hints on how I can add it myself? It should be straightforward since it's just a new resource.

Hi @yauhen-sobaleu
I'm currently lacking the capacity to do the implementation. If you wish to implement it on your own and submit a PR, take a look at the redshift_grant resource: https://github.com/brainly/terraform-provider-redshift/blob/master/redshift/resource_redshift_grant.go

It will have to be extended to support a new object type. Most parts are pretty simple except for constructing a query that will extract and parse the privileges from Redshift itself.