nenetto / terraform-provider-databricks

Terraform Databricks provider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terraform Provider

All the credits to betabandido. I just fork the repository and make some changes to work as I think my terraform scripts should work.

Requirements

  • Terraform 0.12.x
  • Go 1.14 (to build the provider plugin)

Usage

Building The Provider

Clone repository

$ git clone git@github.com:nenetto/terraform-provider-databricks

Enter the provider directory and build the provider

$ cd terraform-provider-databricks
$ go build -o bin/terraform-provider-databricks

Copy the binary generated file into your /.terraform/plugins//terraform-provider-databricks. The name of the plugin is IMPORTANT and must not be changed in order to make it work in terraform

Using the provider

provider "databricks" {
    domain = "<your-account>.cloud.databricks.com"
    token = "<your token>"
}

resource "databricks_notebook" "notebook" {
    path = "/Users/<username>/tf-test"
    language = "PYTHON"
    content = "${base64encode("print('generated by terraform')")}"
}

resource "databricks_cluster" "cluster" {
    name                    = "tf-test"
    spark_version           = "4.1.x-scala2.11"
    node_type_id            = "m4.large"
    num_workers             = 1
    autotermination_minutes = 10

    aws_attributes {
        zone_id          = "eu-west-1c"
        ebs_volume_type  = "GENERAL_PURPOSE_SSD"
        ebs_volume_count = 1
        ebs_volume_size  = 100
    }    
}

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.9+ is required).

About

Terraform Databricks provider


Languages

Language:Go 96.4%Language:HCL 2.5%Language:Shell 1.1%