Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

naviat

🪲
View GitHub Profile
@naviat
naviat / aws-sns-event-template-with-actual-ses-deliverynotification-sns-message
Created October 23, 2017 04:24
Lambda function to process a Amazon SES Delivery Notification message from a SNS Topic into a DynamoDB Table Raw
{
"Records": [
{
"EventSource":"aws:sns",
"EventVersion":"1.0",
"EventSubscriptionArn":"arn:aws:sns:us-west-2:xxxx:xxxx",
"Sns": {
"Type":"Notification",
"MessageId":"88B1B251-2E92-4FC3-BFAA-E3BBD0BAB10A",
"TopicArn":"arn:aws:sns:us-west-2:881222951025:survey-tool-ses-delivery",
@naviat
naviat / README.md
Created October 26, 2017 04:30 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@naviat
naviat / reinvent-2017-youtube.md
Created December 6, 2017 03:57 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

@naviat
naviat / FlowLogs-to-S3-Lambda.py
Created December 7, 2017 07:59 — forked from mlapida/FlowLogs-to-S3-Lambda.py
A Lambda Function for streaming and translating flow logs on the fly. This example was used for HP ArcSight. A full writeup can be found on my site http://mlapida.com/thoughts/exporting-cloudwatch-logs-to-s3-lambda
import boto3
import logging
import json
import gzip
import urllib
import time
from StringIO import StringIO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@naviat
naviat / CloudWatchLogsKinesisFirehose-Lambda.py
Created December 7, 2017 07:59 — forked from mlapida/CloudWatchLogsKinesisFirehose-Lambda.py
A short Lambda Function the can be sent CloudWatch Logs (in the case Flow Logs) and send them to Kinesis Firehose for storage in S3. A full writeup can be found on my site http://mlapida.com/thoughts/exporting-cloudwatch-logs-to-s3-lambda
import boto3
import logging
import json
import gzip
from StringIO import StringIO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
client = boto3.client('firehose')
@naviat
naviat / EC2-Tag-Assets-Lambda.py
Created December 7, 2017 08:00 — forked from mlapida/EC2-Tag-Assets-Lambda.py
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site http://mlapida.com/thoughts/tagging-and-snapshotting-with-lambda
from __future__ import print_function
import json
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
@naviat
naviat / PlexToAlexa-Lambda.py
Created December 7, 2017 08:00 — forked from mlapida/PlexToAlexa-Lambda.py
This is my attempt to get Alexa to return Plex's On Deck and Recently Downloaded lists. It's not the prettiest, but Plex's API isn't the best at the moment. Step-by-step blog post may be found here: http://mlapida.com/thoughts/plex-alexa-interacting-with-your-media-server-through-voice
from __future__ import print_function
import urllib
import urllib2
import xml.etree.ElementTree
import logging
#enable basic logging to CloudWatch Logs
logger = logging.getLogger()
logger.setLevel(logging.INFO)
@naviat
naviat / EC2-Stopped-Tagged-Lambda.py
Created December 7, 2017 08:00 — forked from mlapida/EC2-Stopped-Tagged-Lambda.py
Using a lambda function, stop all instances that are tagged appropriately.
import boto3
import logging
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#define the connection
ec2 = boto3.resource('ec2')
@naviat
naviat / EC2-Snapshot-Lambda.py
Created December 7, 2017 08:00 — forked from mlapida/EC2-Snapshot-Lambda.py
A lambda function for taking a snapshot of all EC2 instances in a region and cleaning the snapshots up after a set number of days. This ones now works best in conjunction with Asset Tagging https://gist.github.com/mlapida/931c03cce1e9e43f147b A full write up can be found on my site http://mlapida.com/thoughts/tagging-and-snapshotting-with-lambda
import boto3
import logging
import datetime
import re
import time
#setup simple logging for INFO
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
@naviat
naviat / azureVMAgentCheck.ps1
Created December 7, 2017 08:01 — forked from mlapida/azureVMAgentCheck.ps1
Azure: Check VM Agent Health
param (
# Define Parameters
[parameter(Mandatory=$true)]
[string]$sub,
[parameter(Mandatory=$true)]
[string]$vm,
[parameter(Mandatory=$true)]
[string]$service