(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": [ | |
{ | |
"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" | |
], |
(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.
@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; \ |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: aws-node | |
rules: | |
- apiGroups: | |
- crd.k8s.amazonaws.com | |
resources: | |
- "*" |
#!/bin/bash | |
# Wrapper around AWS session manager for instance access using public ip and private ip | |
scriptname=$0 | |
# Defaults | |
region='us-east-1' | |
profile='' | |
################################################################################ |
#!/bin/bash | |
usage() { | |
echo "Usage $0 -c mongo_docker_container_name" | |
} | |
while [[ $# > 1 ]] | |
do | |
key="$1" |