A secure, serverless photo download system using AWS Cognito authentication and S3 storage. Users authenticate through Cognito Hosted UI and receive secure, time-limited download links for their photos.
User β Cognito Hosted UI β Lambda Function β S3 Pre-signed URL β Secure Download
Complete system architecture showing all AWS components and data flow. View all diagrams β
- AWS Cognito User Pool: User authentication and management
- AWS Cognito Identity Pool: AWS credentials for authenticated users
- AWS Lambda: Generates secure download links
- AWS S3: Secure photo storage with private access
- AWS IAM: Fine-grained permissions and security policies
- β Secure user authentication via Cognito Hosted UI
- β Time-limited download links (configurable expiry)
- β Private S3 bucket with zero public access
- β Fully serverless architecture (no servers to manage)
- β User-friendly download interface
- β Comprehensive error handling and logging
- β Cost-effective pay-per-use model
- AWS Account with appropriate permissions
- AWS CLI configured with valid credentials
- Basic understanding of AWS serverless services
-
Clone this repository
git clone <this-repo-url> cd secure-photo-downloader
-
Configure your settings
# Edit the configuration in scripts/deploy.sh # Set your email and preferred AWS region
-
Run the deployment script
chmod +x scripts/deploy.sh ./scripts/deploy.sh
-
Upload your photos to S3
aws s3 cp your-photos.zip s3://YOUR-BUCKET-NAME/photos/photos.zip
-
Get your authentication URL
./scripts/get-auth-url.sh
See DEPLOYMENT.md for comprehensive deployment instructions and troubleshooting.
- Zero Trust Architecture: All S3 objects are private by default
- Time-Limited Access: Download links expire automatically (default: 1 hour)
- Authenticated Access Only: Only verified users can access downloads
- Least Privilege IAM: Roles follow security best practices
- Encrypted Storage: S3 server-side encryption enabled
- Audit Trail: CloudWatch logging for all access attempts
- Visit your Cognito Hosted UI URL (provided after deployment)
- Sign up or sign in with your credentials
- Complete email verification if required
- You'll be redirected to the secure download page
- Your photo download will begin automatically
secure-photo-downloader/
βββ README.md # Project overview and quick start
βββ docs/
β βββ DEPLOYMENT.md # Detailed deployment guide
β βββ ARCHITECTURE.md # System architecture and design
β βββ DIAGRAMS.md # Architecture diagrams documentation
βββ diagrams/ # Generated architecture diagrams
β βββ main_architecture.png # Overall system architecture
β βββ security_architecture.png # Security layers and controls
β βββ data_flow.png # Step-by-step process flow
β βββ deployment_architecture.png # Infrastructure deployment
β βββ cost_optimization.png # Cost management strategies
βββ lambda/
β βββ auth-handler.py # Lambda function for authentication
β βββ requirements.txt # Python dependencies
βββ cloudformation/
β βββ auth-stack.yaml # Cognito authentication resources
β βββ storage-stack.yaml # S3 bucket and security policies
β βββ compute-stack.yaml # Lambda function and IAM roles
βββ scripts/
βββ deploy.sh # Main deployment automation
βββ cleanup.sh # Resource cleanup script
βββ get-auth-url.sh # Retrieve authentication URL
The system supports various configuration options:
- Download Expiry: Configure link expiration time
- File Types: Support for various photo formats and archives
- User Management: Customize user pool settings
- Regional Deployment: Deploy to any AWS region
- Custom Domains: Optional custom domain configuration
This serverless architecture is designed for cost efficiency:
- Pay-per-use: Only pay when users download photos
- No idle costs: No servers running 24/7
- S3 Intelligent Tiering: Automatic cost optimization for storage
- Lambda efficiency: Optimized function execution time
Easy to customize for your specific needs:
- Branding: Update UI colors and logos
- File Types: Support different file formats
- User Flows: Modify authentication workflows
- Notifications: Add email/SMS notifications
- Analytics: Integrate with AWS analytics services
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter issues:
- Check the troubleshooting guide
- Review CloudWatch logs for the Lambda function
- Verify your AWS permissions and quotas
- Open an issue with detailed error information
Current version: 1.0.0
Perfect for:
- Event Photography: Secure photo distribution for weddings, parties
- Corporate Events: Professional photo sharing with access control
- Family Sharing: Private photo albums with time-limited access
- Client Deliverables: Secure file delivery for creative professionals
- Educational Content: Controlled access to course materials
Built for secure, scalable photo sharing
