GitHunt
DA

daviguides/sftp-aws-cdk-infra

Infrastructure as Code using AWS CDK to deploy an SFTP server on EC2 integrated with S3, combining automation, security, and scalability in a DevOps-friendly stack.

Deploying a Secure SFTP-to-S3 Pipeline Using AWS CDK

Python
AWS CDK
Infrastructure as Code
License: MIT
Status

Diagram

Infrastructure as Code using AWS CDK to deploy an SFTP server on EC2 integrated with S3 โ€” combining automation, security, and scalability in a DevOps-friendly stack.

๐Ÿงฑ What It Does

This project provisions the following resources using AWS CDK (in Python):

  • A VPC with public/private subnets
  • An S3 bucket for file storage
  • An IAM Role with access to S3
  • An EC2 instance to run the SFTP server (SimpleSFTP)
  • All necessary networking and security group settings

The goal is to demonstrate AWS CDK in a practical portfolio use case, combining two existing components:

๐Ÿ“Œ Also See: EKS + DNS + React + CDK Demo

๐Ÿ”— eks-ec2-cdk-react-dns-demo:
A more advanced CDK portfolio demo โ€” provisions an EKS cluster with EC2 nodes, deploys containerized apps, and configures DNS via Route 53.
Ideal for showcasing full-stack infrastructure skills alongside this SFTP pipeline.

๐Ÿณ Docker Image

The SFTP server used in this project is available as a public Docker image:

๐Ÿ”— daviguides/simple-sftp on Docker Hub

This image is automatically pulled and started on the EC2 instance during provisioning via user_data.

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.11+
  • uv for dependency management (or use pip if preferred)
  • AWS CLI configured and credentials available

Install dependencies

uv venv
source .venv/bin/activate
uv pip install -e .

Bootstrap and Deploy

cdk bootstrap
cdk deploy

๐Ÿงฉ Structure

.
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ cdk.json
โ””โ”€โ”€ sftp_stack/
    โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ sftp_stack.py

๐Ÿ“„ License

MIT License


๐Ÿ”— Check out my full portfolio

๐Ÿ“‚ Explore more repositories on GitHub

๐Ÿ“œ Read the Zero Trust Manifesto for Local Development


๐Ÿ‘จโ€๐Ÿ’ผ Author

Built with โค๏ธ by Davi Luiz Guides