This Terraform script sets up a batch processing workflow in an AWS Databricks Workspace. The workflow consists of several notebooks that perform various tasks such as data processing, quality checks, and data lake population.
Before running this Terraform script, ensure you have the following:
- An AWS Databricks Workspace instance.
- AWS IAM credentials with appropriate permissions.
- Terraform installed on your local machine.
-
Clone this repository to your local machine.
-
Create a
variables.tffile in the project directory and set the following variables:variable "databricks_host" { description = "The host URL of your Databricks workspace" } variable "databricks_token" { description = "The Databricks API token" } variable "databricks_instance_profile" { description = "The ARN of the instance profile to be used by Databricks" }
-
Modify the
main.tffile to reference these variables for Databricks host, token, and instance profile. -
Ensure that your AWS IAM credentials are properly configured and accessible.
-
Ensure you have the necessary Databricks notebooks stored in your workspace under the specified paths.
-
Initialize Terraform in the project directory:
terraform init
-
Review the execution plan:
terraform plan
-
Apply the changes to provision the infrastructure:
terraform apply
-
Once the Terraform apply completes successfully, your Databricks batch processing workflow will be set up according to the configurations specified in the
main.tffile.
main.tf: Contains the main Terraform configuration for provisioning Databricks resources including instance profile, notebooks, cluster, job, etc.variables.tf: Defines input variables for Databricks host, token, and instance profile.README.md: This file, providing an overview of the project and instructions for usage.Notebooks/: Directory containing the Databricks notebooks referenced in the Terraform script.outputs.tf: Defines the output values to be displayed after provisioning.
- Ensure that the specified paths for notebooks in the
main.tffile match the actual paths in your Databricks Workspace. - Customize the email notifications, schedule, cluster settings, and other configurations in the
main.tffile according to your requirements. - Review and test thoroughly before deploying to production environments.
This README.md now includes instructions for creating a `variables.tf` file and setting the necessary variables for Databricks host, token, and instance profile.