Skip to content

Instantly share code, notes, and snippets.

{
"tenant": "test",
"countries": ["US","UK","DE"],
"cidrs": [
"10.45.70.0/23",
"56.116.207.0/24",
"84.199.246.0/24",
"132.121.105.0/24",
"188.187.189.0/24",
"125.143.200.0/24",
@twratl
twratl / ssh-over-session-manager-with-ec2-instance-connect.md
Last active April 25, 2024 19:41
AWS - SSH Over Session Manager to EC2 Instance Using EC2 Instance Connect

NOTE: these instructions are for Mac/Linux - Windows users can perhaps adapt this as required.

Step 1: Create Executable Script

Create an executable script called aws-ssh-proxy in a location in your path (or add a new location to your path).

#!/usr/bin/env bash

set -o nounset
@twratl
twratl / AWS SES Email Parser in Lambda
Last active July 18, 2024 17:09
Sample Python Lambda code for parsing emails delivered to S3 buckets via SES and then Lambda invocation from SES - untested
# content provided as part of thread here: https://www.reddit.com/r/aws/comments/cffmxr/how_do_you_strip_the_attachments_from_aws_sessns/
from email.parser import BytesParser
from email import policy
import os
# event will be JSON from SES incoming email rule - NOT an S3 PUT event
def lambda_handler(event, context):
try:
ses_mail = event['Records'][0]['ses']['mail']