Skip to content

Instantly share code, notes, and snippets.

View zmilleson's full-sized avatar

Zachary Milleson zmilleson

View GitHub Profile
# This takes the Contributor role and creates a new Terraform Contributor role.
# It can do everything that the contributor can do but also create resource locks and assign roles for permissions to resources.
$subscriptionId = Read-Host -Prompt "Input the Subscription ID."
$subObj = Get-AzSubscription -SubscriptionId $subscriptionId
$role = Get-AzRoleDefinition -Name "Contributor"
$role.Name = "Terraform "+$subObj.Name+" Contributor"
$role.Description = "Adds the ability to Add Resource Locks to resources along with the normal Contributor actions."
$role.Actions.Add("Microsoft.Authorization/locks/*")
@zmilleson
zmilleson / azurepolicy-nsgOnSubnets.json
Last active October 21, 2019 14:01
Azure Policy - Require NSGs on all subnets except GatewaySubnet
{
"type": "Microsoft.Authorization/policyDefinitions",
"name": "enforce-nsg-on-subnet-except-gatewaysubnet",
"properties": {
"displayName": "NSG X on every subnet except GatewaySubnet",
"description": "This policy enforces a specific NSG on every subnet except the GatewaySubnet",
"mode": "All",
"parameters": {},
"policyRule": {
"if": {
@zmilleson
zmilleson / getValueFromvCACCAFELiteralMap.js
Created August 1, 2018 19:34 — forked from trisharia/getValueFromvCACCAFELiteralMap.js
Get the value from vCACCAFELiteralMap
// VMware vRealize Orchestrator action sample
//
// Returns the value of a given key defined in a vCACCAFE:vCACCAFELiteralMap
// Performs depth-first search
//
// For vRA 7.0+/vRO 7.0+
//
// Action Inputs:
// map - Any - the vCACCAFE:vCACCAFELiteralMap to parse
// key - string - Key for searching in the literal map
### Keybase proof
I hereby claim:
* I am zmilleson on github.
* I am zmilleson (https://keybase.io/zmilleson) on keybase.
* I have a public key whose fingerprint is 4712 41E8 1C05 5C8A AD3A BB82 ADF8 056C 95D5 6FCA
To claim this, I am signing this object: