Skip to content

Instantly share code, notes, and snippets.

@cicorias
Created July 18, 2025 13:55
Show Gist options
  • Save cicorias/129a40c1ee588d9b7171e0c2eaa6f0fa to your computer and use it in GitHub Desktop.
Save cicorias/129a40c1ee588d9b7171e0c2eaa6f0fa to your computer and use it in GitHub Desktop.
script that runs a check after a terraform refresh or apply checking RBAC assignments
#!/usr/bin/env bash
set -e
getcosmos=$(terraform output -raw list_cosmos_container_permissions_command)
echo $getcosmos
$getcosmos
getaks=$(terraform output -raw list_role_assignments_aks_command)
echo "$getaks"
eval $getaks
getfunapp=$(terraform output -raw list_role_assignments_function_app_command)
echo "$getfunapp"
eval $getfunapp
resourceGroup=$(terraform output -raw resource_group_name)
aksCluster=$(terraform output -raw aks_cluster_name)
az aks show -g "$resourceGroup" -n "$aksCluster" --query "identity"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment