<?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 Re: terraform create multiple db user in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11028#M6069</link>
    <description>&lt;P&gt;Thanks @Zach King​&amp;nbsp;this solution work for me.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 05:10:34 GMT</pubDate>
    <dc:creator>francly</dc:creator>
    <dc:date>2022-08-11T05:10:34Z</dc:date>
    <item>
      <title>terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11024#M6065</link>
      <description>&lt;P&gt;Hi, follow the example to create one user. It's working however I want to create multiple users, I have tried many ways but still cannot get it work, please share some idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/user" target="test_blank"&gt;https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/user&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data "databricks_group" "admins" {
  display_name = "admins"
}
&amp;nbsp;
resource "databricks_user" "me" {
  user_name = "me@example.com"
}
&amp;nbsp;
resource "databricks_group_member" "i-am-admin" {
  group_id  = data.databricks_group.admins.id
  member_id = databricks_user.me.id
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Aug 2022 14:28:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11024#M6065</guid>
      <dc:creator>francly</dc:creator>
      <dc:date>2022-08-06T14:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11025#M6066</link>
      <description>&lt;P&gt;count is one of the meta-parameters available to all resources. We can specify the number of identical resources to create.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.tellthebell.page/" alt="https://www.tellthebell.page/" target="_blank"&gt;Taco Bell Survey&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 06:52:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11025#M6066</guid>
      <dc:creator>Hopkins696</dc:creator>
      <dc:date>2022-08-08T06:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11026#M6067</link>
      <description>&lt;P&gt;You would have to create multiple "databricks_user" resources. Using &lt;A href="https://learn.hashicorp.com/tutorials/terraform/count?in=terraform/configuration-language" alt="https://learn.hashicorp.com/tutorials/terraform/count?in=terraform/configuration-language" target="_blank"&gt;count&lt;/A&gt; or &lt;A href="https://learn.hashicorp.com/tutorials/terraform/for-each?in=terraform/configuration-language" alt="https://learn.hashicorp.com/tutorials/terraform/for-each?in=terraform/configuration-language" target="_blank"&gt;foreach&lt;/A&gt; should help you with creating multiple of the same resource.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 14:11:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11026#M6067</guid>
      <dc:creator>Cedric</dc:creator>
      <dc:date>2022-08-10T14:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11027#M6068</link>
      <description>&lt;P&gt;as @Cedric Law Hing Ping​&amp;nbsp;mentioned, you can use `count` or `foreach` in Terraform to do this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a simple example:&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;locals {&lt;/P&gt;&lt;P&gt;  user_emails = toset([&lt;/P&gt;&lt;P&gt;    "user1@example.com",&lt;/P&gt;&lt;P&gt;    "user2@example.com",&lt;/P&gt;&lt;P&gt;    "user3@example.com"&lt;/P&gt;&lt;P&gt;  ])&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resource "databricks_user" "engineers" {&lt;/P&gt;&lt;P&gt;  for_each  = local.user_emails&lt;/P&gt;&lt;P&gt;  user_name = each.value&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data "databricks_group" "admins" {&lt;/P&gt;&lt;P&gt;  display_name = "admins"&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resource "databricks_group_member" "engineer-admins" {&lt;/P&gt;&lt;P&gt;  for_each = databricks_user.engineers&lt;/P&gt;&lt;P&gt;  group_id  = data.databricks_group.admins.id&lt;/P&gt;&lt;P&gt;  member_id = each.value.id&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 00:27:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11027#M6068</guid>
      <dc:creator>zcking</dc:creator>
      <dc:date>2022-08-11T00:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11028#M6069</link>
      <description>&lt;P&gt;Thanks @Zach King​&amp;nbsp;this solution work for me.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 05:10:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/11028#M6069</guid>
      <dc:creator>francly</dc:creator>
      <dc:date>2022-08-11T05:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: terraform create multiple db user</title>
      <link>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/58234#M31059</link>
      <description>&lt;P&gt;What if I want to give User Name along with the email ID?&lt;BR /&gt;I used below code but its not helping(code is not failing, but not adding user name)&lt;BR /&gt;It seems this code line: "&lt;SPAN&gt;display_name&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;each.key&lt;/SPAN&gt;" is not working. Pls suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;terraform&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;required_providers&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;databricks&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"databricks/databricks"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt; &lt;SPAN&gt;"databricks"&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#alias = "workspace"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;host&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"&lt;A href="https://adb-xxxx.xx.azuredatabricks.net" target="_blank"&gt;https://adb-xxxx.xx.azuredatabricks.net&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;token&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"dapixxxxx"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;locals&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;users&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;User1&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"user1@example.com"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;User2&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"user2@example.com"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;User3&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;"user3@example.com"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resource&lt;/SPAN&gt; &lt;SPAN&gt;"databricks_user"&lt;/SPAN&gt; &lt;SPAN&gt;"engineers"&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for_each&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;local.users&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;display_name&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;each.key&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;user_name&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;each.value&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;allow_cluster_create&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;allow_instance_pool_create&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;databricks_sql_access&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;workspace_access&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jan 2024 07:10:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/terraform-create-multiple-db-user/m-p/58234#M31059</guid>
      <dc:creator>Natlab</dc:creator>
      <dc:date>2024-01-23T07:10:10Z</dc:date>
    </item>
  </channel>
</rss>

