<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Automating DDLs and Privilege management in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/automating-ddls-and-privilege-management/m-p/21317#M14517</link>
    <description>&lt;P&gt;How do you automate table creation and management of privilege / grants on securable objects (tables, views, etc.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had idea to use terraform to manage above, but terraform doesn't work with managed tables - it allows to create table but then there are some errors while running `show create table` or `describe table` for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have multi-region, multi-tenant environment where I would like to automate process of adding the tables and manage privileges. The schemas across Regions are the same, catalogs might change a bit depends on the region/tenant/customer/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first attempt is:&lt;/P&gt;&lt;P&gt;1. upload notebook that have statements like:&lt;/P&gt;&lt;P&gt;DROP and CREATE EXTERNAL TABLES&lt;/P&gt;&lt;P&gt;CREATE IF NOT EXISTS managed tables.&lt;/P&gt;&lt;P&gt;Grant privileges on those catalogs, schemas, tables (views in the future, maybe some UDFs and other objects).&lt;/P&gt;&lt;P&gt;2. Create workflow to execute that notebook above&lt;/P&gt;&lt;P&gt;workflow can take some params like catalog name, depends on env (dev/stg/prod), and region (eu-west-1, eu-central-1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure yet about privileges here. Granting access it's we can run over again GRANT ... but Revoking access seems bit problematic, I would need to handle the difference. Check first groups that have access to objects, and if I pass as param different groups then revoke. It's not a problem, I can handle it ,but I would like to know how others are doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 08:27:40 GMT</pubDate>
    <dc:creator>Pat</dc:creator>
    <dc:date>2022-11-22T08:27:40Z</dc:date>
    <item>
      <title>Automating DDLs and Privilege management</title>
      <link>https://community.databricks.com/t5/data-engineering/automating-ddls-and-privilege-management/m-p/21317#M14517</link>
      <description>&lt;P&gt;How do you automate table creation and management of privilege / grants on securable objects (tables, views, etc.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had idea to use terraform to manage above, but terraform doesn't work with managed tables - it allows to create table but then there are some errors while running `show create table` or `describe table` for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have multi-region, multi-tenant environment where I would like to automate process of adding the tables and manage privileges. The schemas across Regions are the same, catalogs might change a bit depends on the region/tenant/customer/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My first attempt is:&lt;/P&gt;&lt;P&gt;1. upload notebook that have statements like:&lt;/P&gt;&lt;P&gt;DROP and CREATE EXTERNAL TABLES&lt;/P&gt;&lt;P&gt;CREATE IF NOT EXISTS managed tables.&lt;/P&gt;&lt;P&gt;Grant privileges on those catalogs, schemas, tables (views in the future, maybe some UDFs and other objects).&lt;/P&gt;&lt;P&gt;2. Create workflow to execute that notebook above&lt;/P&gt;&lt;P&gt;workflow can take some params like catalog name, depends on env (dev/stg/prod), and region (eu-west-1, eu-central-1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not 100% sure yet about privileges here. Granting access it's we can run over again GRANT ... but Revoking access seems bit problematic, I would need to handle the difference. Check first groups that have access to objects, and if I pass as param different groups then revoke. It's not a problem, I can handle it ,but I would like to know how others are doing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Pat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 08:27:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/automating-ddls-and-privilege-management/m-p/21317#M14517</guid>
      <dc:creator>Pat</dc:creator>
      <dc:date>2022-11-22T08:27:40Z</dc:date>
    </item>
  </channel>
</rss>

