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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group