This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this Lambda function inside a VPC with a MongoDB instance inside it. | |
# Set up security groups to allow the function to communicate with the MongoDB endpoint | |
# NAT service or NAT instance is required because the function need to access AWS KMS, which an external endpoint | |
# Set four environment variables for the function containing the details required for the MongoDB endpoint uri | |
# I used the Bitnami MongoDB install from the AWS Marketplace | |
import boto3 | |
import os | |
from base64 import b64decode |
Tested with
Python 2.7, OS X 10.11.3 El Capitan, Apache Spark 1.6.0 & Hadoop 2.6
Download Apache Spark and build it or download the pre-built version.