(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
{ | |
"Version":"2012-10-17", | |
"Statement":[ | |
{ | |
"Effect":"Allow", | |
"Action": "secretsmanager:GetSecretValue", | |
"Resource": "*", | |
"Condition": { | |
"secretsmanager:ResourceTag/Project": "${aws:PrincipalTag/Project}" | |
} |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"apigateway:GET", | |
"apigateway:POST", | |
"apigateway:PUT", |
import json, os | |
import boto3 | |
from botocore.exceptions import ClientError | |
def lambda_handler(event, context): | |
""" | |
Lambda Handler | |
Triggers AWS CodePipeline | |
:param event: takes event triggered by cloudwatch rule |
SELECT eventname, useridentity.username, sourceIPAddress, eventtime, requestparameters | |
FROM cloudtrail_logs_athena_table | |
WHERE (requestparameters like '%rtb-xxxxxxx%') limit 10; |
SELECT eventname, useridentity.username, sourceIPAddress, eventtime, requestparameters | |
FROM cloudtrail_logs_athena_table | |
WHERE (requestparameters like '%rtb-xxxxxxx%') limit 10; |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "NoPurposeTag", | |
"Effect": "Deny", | |
"Action": [ | |
"ec2:RunInstances", | |
"ec2:CreateVolume" | |
], |
#!/bin/bash | |
# install packages/dependencies for compilation | |
sudo yum -y install gcc make ncurses-devel | |
cd /tmp | |
# the latest version of ncdu is published here: http://dev.yorhel.nl/ncdu | |
# update the link below if necessary: | |
wget -nv http://dev.yorhel.nl/download/ncdu-1.10.tar.gz |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/bin/bash | |
# Wrapper around AWS session manager for instance access using public ip and private ip | |
scriptname=$0 | |
# Defaults | |
region='us-east-1' | |
profile='' | |
################################################################################ |
@export ENIS=$$(aws ec2 describe-network-interfaces --filters "Name=status,Values=available" | jq ".NetworkInterfaces[] | select(.VpcId == \"$${VPC_ID}\") | .NetworkInterfaceId"); \ | |
if [[ ! -z $${DRY_RUN} ]]; then \ | |
echo "Running in dry run mode! No changes will be made. The following ENIs would be deleted:"; \ | |
echo $${ENIS}; \ | |
exit 0; \ | |
else \ | |
for eni in $$(echo $${ENIS}| tr -d "\""); \ | |
do \ | |
aws ec2 delete-network-interface --network-interface-id $${eni}; \ | |
done; \ |