Skip to content

Instantly share code, notes, and snippets.

View mgla's full-sized avatar
🎯
Focusing

Maik Glatki mgla

🎯
Focusing
View GitHub Profile
@mgla
mgla / AWS.md
Last active September 11, 2018 13:21
So, you want start with AWS CloudFormation

So, you want start with AWS CloudFormation

About this document

These are some unsorted notes I am taking along my journey with AWS CloudFormation (CFN). I plan to collect some good practices here

Things to think of beforehand

While AWS can be used cost for cost-saving, it is not for the weak of wallet at first. If you just want to run a VM with a public IP, you probably won't benefit from AWS at all.

VPCs (subnetting)

@mgla
mgla / get_iam_role_from_ec2.sh
Last active June 7, 2018 12:22
Get AWS IAM instance role
# Get and print IAM instance role
ROLE=$(curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ -s); echo $ROLE
@mgla
mgla / json2yaml.sh
Last active June 7, 2018 12:22
json 2 yaml oneline
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < input.json > output.yaml
@mgla
mgla / awsbrokensubscriptions.sh
Last active November 23, 2016 12:53
Find AWS SNS subscription that can be cancelled without authentication.
AWS_PROFILE=aws-profile; for id in `aws --profile $AWS_PROFILE sns list-subscriptions | jq -r '.Subscriptions |.[] | .SubscriptionArn '`; do aws --profile $AWS_PROFILE sns get-subscription-attributes --subscription-arn $id | jq '.Attributes | select(.ConfirmationWasAuthenticated == "false") | { Endpoint: .Endpoint, ConfirmationWasAuthenticated: .ConfirmationWasAuthenticated, Protocol: .Protocol}'; done