Skip to main content

Databricks Example: Create Account User

In this quick start we will show you how you can use Hyper Cloud Automation to manage resources in a Databricks account. The example will walk you through creating a simple environment, adding a module to create users, and deploy it.

Prerequisite

For this example we will assume that you already have a Databricks account. We will need to create a service principle to be used by Hyper Cloud Automation.

  1. Go to your cloud databricks accout https://accounts.cloud.databricks.com/
  2. In the left navigation menu select User management
  3. In the User management window select Service Principals tab
  4. Click on Add service principle button
  5. For Name put hypercloud-automation and press Add
  6. Click on hypercloud-automation
  7. Click on Roles tab and enable Role Admin Admin Role
  8. Go back to Principle information tab
  9. Click on Generate secret tab
  10. Note down values for Secret and Client ID Service Principle Secret
  11. In the Hyper Cloud Automation click on Organization in the left hand navigation menu.
  12. Scroll to the Cloud Keys section.
  13. Press on +Add button.
  14. For Cloud Key choose DATABRICKS_CLIENT_SECRET.
  15. Paste the value of the Secret from the above step
  16. For Environment choose global. client secret
  17. Press Save button

Create environment

In this example we will create a simple environment which consist of a module that deploys a Databricks users.

  1. In the left naviation menu select Environments
  2. Click on Add Environment
  3. Name your environment example-db-environment
  4. Press Add
  5. Select EXAMPLE-DB-ENVIRONMENT in the tabs
  6. Press on the + button in the Root of the Environment
  7. Select AWS Databricks Account Data Source
    tip

    Press Expand Environment button to expand/collapse the tree

  8. In the AWS Databricks Account node press on the button and fill in:
    1. Account ID with the value of your Databricks Account ID.
    2. Client ID from the Prerequisites (Client ID is created along with the secret in the steps outlined in Prerequisites) Data source
  9. Press Save
  10. On AWS Databricks Account node press and select Databricks Account Users Module
  11. Click on button and set the settings like in this image GCS Module Settings
  12. Scroll down and press Save.

Your first simple environment should look something like this: Simple Environment

Deploy

Deployment process consists of running a plan action folowed by approval process and then running apply

  1. In your environment locate Databricks Account Users module
  2. Press on the in the module to start the plan. Notice that the Deployment Status will change.
  3. Once the Deployment Status is changed to PLAN SUCCESS click on button to pop up the deployment PLAN
  4. In the top right corner press TERRAFORM-APPLY button
  5. Wait for deployment to finish. Apply Success
  6. Go to your Databricks Account
  7. Go to User management
  8. You will find the user in the list Deployed User

To review deployments log do:

  1. In the left navigation menu click on Deployment Jobs
  2. Click on the deployment job IDs to see the full logs Deploment Jobs

Destroy the bucket

  1. In the naviagion menu on the left select Environments
  2. In the tabs select EXAMPLE-DB-ENVIRONMENT
  3. Click on Expand Environment
  4. Click on button on the Databricks Account Users module.
  5. Confirm the destruction plan
  6. Wait for Destroy to complete
  7. Go to your Databricks Account
  8. Go to User management
  9. The user is deleted

Cleanup

  1. In the left navigation menu click on Organization
  2. Delete the environment EXAMPLE-DB-ENVIRONMENT. See also delete envrionment
  3. Delete the service principle created in prerequisite