Skip to content

Instantly share code, notes, and snippets.

View brucedkyle's full-sized avatar

Bruce Kyle brucedkyle

View GitHub Profile
@brucedkyle
brucedkyle / create-rbac-auth-for-terraform.bash
Last active May 23, 2020 20:11
set environment variables for Terraform
## Requires jq .. to install see: https://stedolan.github.io/jq/download/
# set some environment variables to use to create the service principal
export SUBSCRIPTION_ID=3464892e-e827-4752-bad5-b4f93c00dbbe
export PROJECT_NAME="wus2-azure-aks-terraform-demo"
az account set --subscription="${SUBSCRIPTION_ID}"
# create the service principal to the subscription scope and save it to an auth file
TF_SERVICE_PRINCIPAL=$(az ad sp create-for-rbac --skip-assignment --role 'Contributor' --name rbac-tf-$PROJECT_NAME --output json --scopes="/subscriptions/${SUBSCRIPTION_ID}")
@brucedkyle
brucedkyle / terraform-version.bash
Last active May 5, 2020 23:41
Get version of Terraform
terraform --version