Skip to content

Instantly share code, notes, and snippets.

@sherzodinaev
sherzodinaev / set-hostname-windows-ssm.yaml
Created February 23, 2018 01:47
Set Windows hostname via SSM
---
schemaVersion: '2.2'
description: Sets computer name for computer(s) that is(are) part of the domain, using the value of Name tag for the selected resource(s).
mainSteps:
- action: aws:runPowerShellScript
name: setComputerNameFromTag
precondition:
StringEquals:
- platformType
- Windows
@sherzodinaev
sherzodinaev / generate-iam-assets.sh
Last active December 31, 2019 17:09
IAM asset generator
#!/bin/bash
export AWS_PROFILE='default'
mkdir -p iam/policies
POLICIES=$(aws iam list-policies --scope Local --query "Policies[*].{name: PolicyName, version: DefaultVersionId, arn: Arn}")
echo $POLICIES | jq -c '.[]' | \
while read policy; do