Dynamic Connections for Models

  • 28 August 2018
  • 3 replies

Is there a way to dynamically change a connection in a model so that we can take advantage of Snowflake secure views. Basically, in our Snowflake instance we will have secure views for each customer’s data and depending on the Looker user or group we want to use a different connection into the warehouse so that we can restrict access at the warehouse level. I know that I can only use one connection in a model and I can duplicate the models for each customer and have different connections; however, that will quickly become a maintenance nightmare. I would prefer to dynamically switch the connection so that the data reflects the correct secure view.

3 replies

Hi @dkline,

There is a way to parameterize connections using user attributes. In the connection settings, if you click on the person icon on the right hand side of the text box for the connection name you can set the connection name dynamically based on that user attribute. The other settings can be dynamically set based on user attributes.

Here you have further info about it.


I wonder why it is not possible to parameterise connections when using SSL tunnel? 


User attributes in connection parameter works fine for most DBs but not for GCP BIGQUERY, because it requires credentials file below which cannot be dynamically passed based on user attribute. This is causing a lot of complexities in switching between environments..

Service Account JSON/P12 File