Skip to content

Instantly share code, notes, and snippets.

View kunalworldwide's full-sized avatar
🎯
Focusing

Kunal Das kunalworldwide

🎯
Focusing
View GitHub Profile
@kunalworldwide
kunalworldwide / chromedriver.py
Last active April 28, 2021 15:03 — forked from primaryobjects/chromedriver.py
Automatically download the latest chromedriver for Selenium in Python. Works on Linux, Mac, Windows. Cross platform!
#!/usr/bin/env python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import WebDriverException, SessionNotCreatedException
import sys
import os
import pathlib
import urllib.request
import re
import zipfile
data "azurerm_client_config" "Current" {}
resource "azurerm_resource_group" "RG" {
name = var.ResourceGroup.Name
location = var.ResourceGroup.Location
}
resource "azurerm_data_factory" "DataFactory" {
name = "DataFactory Name"
location = azurerm_resource_group.RG.location
resource_group_name = azurerm_resource_group.RG.name
identity {
type = "SystemAssigned"
}
}
resource "azurerm_databricks_workspace" "Databricks" {
location = azurerm_resource_group.RG.location
name = "Databricks Name"
resource_group_name = azurerm_resource_group.RG.name
managed_resource_group_name = "Databricks Managed Resource Group"
sku = "Databricks Sku"
custom_parameters {
no_public_ip = true
virtual_network_id = azurerm_virtual_network.DatabricksVnet.id
resource "azurerm_virtual_network" "DatabricksVnet" {
name = "VNET NAME"
resource_group_name = azurerm_resource_group.RG.name
location = azurerm_resource_group.RG.location
address_space = ["VNET CIDR"]
}
resource "azurerm_subnet" "DatabricksSubnetPublic" {
name = "VirtualNetwork PublicSubnet Name"
resource_group_name = azurerm_resource_group.RG.name
virtual_network_name = azurerm_virtual_network.DatabricksVnet.name
address_prefixes = ["VirtualNetwork PublicSubnet CIDR"]
service_endpoints = ["Microsoft.Storage"]
delegation {
name = "Microsoft.Databricks.workspaces"
service_delegation {
resource "azurerm_network_security_group" "DatabricksNSG" {
name = "VirtualNetwork NSG Name"
resource_group_name = azurerm_resource_group.RG.name
location = azurerm_resource_group.RG.location
}
resource "azurerm_subnet" "DatabricksSubnetPrivate" {
name = "VirtualNetwork PrivateSubnet Name"
resource_group_name = azurerm_resource_group.RG.name
virtual_network_name = azurerm_virtual_network.DatabricksVnet.name
address_prefixes = ["VirtualNetwork PrivateSubnet CIDR"]
delegation {
name = "Microsoft.Databricks.workspaces"
service_delegation {
name = "Microsoft.Databricks/workspaces"
resource "azurerm_subnet_network_security_group_association" "public" {
subnet_id = azurerm_subnet.DatabricksSubnetPublic.id
network_security_group_id = azurerm_network_security_group.DatabricksNSG.id
}
resource "azurerm_subnet_network_security_group_association" "private" {
subnet_id = azurerm_subnet.DatabricksSubnetPrivate.id
network_security_group_id = azurerm_network_security_group.DatabricksNSG.id
}