Skip to content

Instantly share code, notes, and snippets.

View ljmocic's full-sized avatar

Ljubiša Moćić ljmocic

View GitHub Profile
import boto3
import email
import json
from pprint import pprint
from base64 import b64decode
s3 = boto3.client('s3')
BUCKET_NAME = ''
def lambda_handler(event, context):
import datetime
import csv
import boto3
from boto3.session import Session
MAX_DAYS_OLD = 15
# Checks if access key is older than predefined number of days
# Read more about it
# https://ljmocic.medium.com/publish-simple-node-js-aws-lambda-layer-a87c00afdd83
mkdir nodejs
cd nodejs
npm i axios
rm -rf package-lock.json
cd ..
zip -r axios.zip nodejs
import json
import boto3
BUCKET = 'your-bucket-name'
KEY = 'your-file-key'
s3 = boto3.resource('s3')
file_object = s3.Object(BUCKET, KEY)
json_content = json.loads(file_object.get()['Body'].read())
@ljmocic
ljmocic / docker-compose.yml
Last active November 10, 2025 13:24
midgard-setup
version: '3'
services:
midgard:
build:
context: .
dockerfile: Dockerfile
image: midgard
restart: always
ports: