cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
Esteemed Contributor
Esteemed Contributor

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.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.