cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Terraform Global Init Script base64encoding

kfoster
Contributor

I am working on converting manual global init scripts into a terraform IaC process for multiple environments. Within terraform, we are using the resource "databricks_global_init_script" and set the content_base64 with the following:

base64encoded(<<-EOT
#!/bin/bash
pip3 install pyodbc
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list 
apt-get update
ACCEPT_EULA=Y apt-get install msodbcsql17
pip3 install --upgrade pyodbc
EOT
)

However, when I call the rest api's to view the global init script to compare against my manual entry, the encoded base64 string is different. The version terraform is creating is not working. Why would terraform be creating a different encoded base64 string?

2 REPLIES 2

Atanu
Databricks Employee
Databricks Employee

I am looking into it @Kristian Foster​ 

Are you able to get it working?

My work around is to edit and resave what terraform is creating, which is not ideal. This is the only way I can get the base64encoded string to be correct.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now