Terraform scripts to spool up an AI / Data Science dev box in Azure.
- Terraform and Azure CLI installed
- If this is run from within WSL2, DNS needs to be disabled as there is currently an issue in conjunction with Terraform
- The Terraform script assumes that an SSH key public key exists under
~/.ssh/id_rsa.pub
.
terraform init
az login
terraform plan -out main.tfplan
terraform apply "main.tfplan"
# Wait for it...
# Get the public IP:
terraform output public_ip_address
# Sign in via SSH.
ssh sral@<public ip address>
[ ] Use Codespaces encrypted secrets: https://docs.github.com/en/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces
less /var/log/cloud-init-output.log
Run Jupyter lab:
jupyter lab
On the client, open an SSH tunnel to connect to JupyterLab:
ssh -N -L 8888:localhost:8888 {user]@{host}
Then point your browser to https://localhost:8888
terraform apply -destroy
- Terraform instructions: https://docs.microsoft.com/en-us/azure/developer/terraform/create-linux-virtual-machine-with-infrastructure
- https://www.terraform.io/downloads
- Terraform's Azure RM provider documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
- Passing custom data scripts to the VM: https://sbulav.github.io/terraform/terraform-azurerm-compute-custom-data/