Skip to content

Instantly share code, notes, and snippets.

View joelsapp's full-sized avatar

Joel Sapp joelsapp

View GitHub Profile
@oneamitj
oneamitj / lambda_function.py
Created August 10, 2022 16:29
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