Skip to content

Instantly share code, notes, and snippets.

View khadersyed's full-sized avatar
💭
I may be slow to respond.

Khader Syed khadersyed

💭
I may be slow to respond.
View GitHub Profile
@khadersyed
khadersyed / lambda_function.py
Created February 22, 2023 01:52 — forked from oneamitj/lambda_function.py
Lambda Function to use as authentication provider with user management from Secret Manager for Transfer Family.
# This code is part of Transfer Family Tutorial: https://aws.amazon.com/blogs/storage/enable-password-authentication-for-aws-transfer-family-using-aws-secrets-manager-updated/
# Full zip with CloudFormation code mentioned on that tutorial: https://s3.amazonaws.com/aws-transfer-resources/custom-idp-templates/aws-transfer-custom-idp-secrets-manager-sourceip-protocol-support-apig.zip
# My step wise spinning up SFTP in Transfer Family with username and password:
import os
import json
import boto3
import base64
from ipaddress import ip_network, ip_address
@khadersyed
khadersyed / s3_glue_athena.py
Created February 21, 2023 20:25
Simple S3/Glue/Athena Script
import boto3
import json
import logging
from botocore.exceptions import ClientError
def create_s3_bucket(s3_bucket_name):
# Create S3 client
iam = boto3.client("s3")