AWS Learning
Storage

AWS Transfer Family

Managed SFTP/FTPS/FTP/AS2, File Transfer to S3/EFS

Tổng quan

AWS Transfer Family là dịch vụ fully managed cho phép transfer files vào/ra AWS storage (S3, EFS) sử dụng các protocols truyền thống:

┌─────────────────────────────────────────────────────────────────┐
│              AWS TRANSFER FAMILY                                │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Legacy Systems / Partners / Clients                            │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐                │
│  │  SFTP   │ │  FTPS   │ │   FTP   │ │   AS2   │                │
│  └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘                │
│       │           │           │          │                      │
│       └───────────┴─────┬─────┴───────────┘                     │
│                         ▼                                       │
│              ┌─────────────────────┐                            │
│              │   Transfer Family   │  ← Fully managed           │
│              │      Server         │    No infrastructure       │
│              └──────────┬──────────┘                            │
│                        │                                        │
│           ┌─────────────┴─────────────┐                         │
│           ▼                           ▼                         │
│    ┌─────────────┐            ┌─────────────┐                   │
│    │     S3      │            │     EFS     │                   │
│    └─────────────┘            └─────────────┘                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Key benefits:

  • ❌ Không cần quản lý SFTP/FTP servers
  • ✅ Tích hợp native với S3/EFS
  • ✅ Giữ nguyên workflows hiện tại (partners vẫn dùng SFTP như cũ)
  • ✅ High availability, scalability tự động

Protocols hỗ trợ

ProtocolPortMô tảUse case
SFTP22SSH File Transfer ProtocolPhổ biến nhất, secure
FTPS21FTP over SSL/TLSLegacy systems cần encryption
FTP21Plain FTP (unencrypted)Legacy, không khuyến khích
AS2443Applicability Statement 2EDI, B2B transactions

SFTP vs FTPS vs FTP

┌──────────────────────────────────────────────────────────────────┐
│              PROTOCOL COMPARISON                                 │
├──────────────────────────────────────────────────────────────────┤
│                                                                  │
│  SFTP (SSH File Transfer Protocol):                              │
│  • Chạy trên SSH (port 22)                                       │
│  • Mọi thứ encrypted                                             │
│  • ✅ Recommended cho new implementations                        │
│                                                                  │
│  FTPS (FTP Secure):                                              │
│  • FTP + TLS/SSL encryption                                      │
│  • 2 modes: Explicit (port 21) / Implicit (port 990)             │
│  • Dùng khi partner chỉ support FTPS                             │
│                                                                  │
│  FTP (Plain):                                                    │
│  • ⚠️ KHÔNG encrypted - chỉ dùng nội bộ                          │
│  • Legacy compatibility only                                     │
│                                                                  │
│  AS2:                                                            │
│  • HTTP-based, EDI transactions                                  │
│  • Digital signatures, encryption, receipts                      │
│  • B2B commerce (retail, healthcare)                             │
│                                                                  │
└──────────────────────────────────────────────────────────────────┘

Storage backends

Amazon S3

Transfer Family Server ──► S3 Bucket

                              ├── /user1/uploads/
                              ├── /user2/uploads/
                              └── /shared/

Features với S3:

  • Map users đến specific prefixes (folders)
  • Dùng S3 features: versioning, lifecycle, encryption
  • Cross-region replication vẫn hoạt động

Amazon EFS

Transfer Family Server ──► EFS File System

                              ├── /home/user1/
                              ├── /home/user2/
                              └── /shared/

Features với EFS:

  • POSIX permissions
  • Shared access với EC2, Lambda, etc.
  • NFS mount từ on-premises

Authentication

3 phương thức authentication

┌─────────────────────────────────────────────────────────────────┐
│              AUTHENTICATION OPTIONS                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  1. Service-managed (AWS managed):                              │
│     • SSH keys stored in AWS                                    │
│     • Đơn giản nhất                                             │
│     • Quản lý qua Console/API                                   │
│                                                                 │
│  2. AWS Directory Service:                                      │
│     • Microsoft AD / AD Connector                               │
│     • Username/password từ AD                                   │
│     • Tích hợp với existing AD                                  │
│                                                                 │
│  3. Custom Identity Provider (Lambda):                          │
│     • Lambda function xử lý authentication                      │
│     • Tích hợp với bất kỳ IdP nào                               │
│     • Flexible nhất                                             │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Custom Identity Provider example

User login ──► Transfer Family ──► API Gateway ──► Lambda


                                              ┌───────────────┐
                                              │ Your database │
                                              │ LDAP, Okta,   │
                                              │ Cognito, etc. │
                                              └───────────────┘
# Lambda function example
def lambda_handler(event, context):
    username = event['username']
    password = event['password']
    
    # Validate against your IdP
    if validate_user(username, password):
        return {
            'Role': 'arn:aws:iam::123456789:role/transfer-user-role',
            'HomeDirectory': f'/my-bucket/{username}',
            'Policy': '...'  # Optional scoped-down policy
        }
    else:
        return {}  # Empty = authentication failed

Kiến trúc

Endpoint types

TypeAccessibilityIP AddressUse case
PublicInternetAWS-ownedPartners truy cập qua internet
VPCVPC onlyPrivate IPInternal, on-premises via VPN/DX
VPC with InternetBothElastic IPFixed IP cho firewall whitelist

VPC Endpoint Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         VPC                                     │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌─────────────────┐         ┌─────────────────┐                │
│  │  Private Subnet │         │  Private Subnet │                │
│  │     (AZ-a)      │         │     (AZ-b)      │                │
│  │  ┌───────────┐  │         │  ┌───────────┐  │                │
│  │  │  ENI      │  │         │  │  ENI      │  │                │
│  │  │ 10.0.1.5  │  │         │  │ 10.0.2.5  │  │                │
│  │  └─────┬─────┘  │         │  └─────┬─────┘  │                │
│  └────────┼────────┘         └────────┼────────┘                │
│           │                          │                          │
│           └───────────┬───────────────┘                         │
│                       ▼                                         │
│              ┌─────────────────┐                                │
│              │ Transfer Family │                                │
│              │     Server      │                                │
│              └────────┬────────┘                                │
│                      │                                          │
│                       ▼                                         │
│              ┌─────────────────┐                                │
│              │       S3        │                                │
│              └─────────────────┘                                │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

        │ VPN / Direct Connect

┌─────────────────┐
│   On-premises   │
└─────────────────┘

Use Cases

Use CaseProtocolStorage
Partner data exchangeSFTPS3
EDI/B2B transactionsAS2S3
Migrate FTP serversFTPS/SFTPS3/EFS
Data lake ingestionSFTPS3
Shared file storageSFTPEFS

Ví dụ: Partner uploads

Partner A (SFTP) ──┐
                   │     ┌──────────────┐     ┌─────────────┐
Partner B (SFTP) ──┼────►│ Transfer     │────►│  S3 Bucket  │
                   │     │ Family Server│     │             │
Partner C (AS2)  ──┘     └──────────────┘     └──────┬──────┘


                                              ┌─────────────┐
                                              │ Lambda/Glue │
                                              │ Processing  │
                                              └─────────────┘

Pricing

ComponentCost
Endpoint$0.30/hour ($216/month) per protocol
Data transfer$0.04/GB (upload), $0.04/GB (download)
AS2 messages$0.005 per message traded

Ví dụ:

  • 1 SFTP server chạy 24/7 = ~$216/month
  • Upload 100GB/month = $4
  • Total: ~$220/month

⚠️ Lưu ý: Cost chính là endpoint hourly fee, data transfer thường nhỏ hơn


So sánh với các giải pháp khác

FeatureTransfer FamilySelf-managed SFTPThird-party
ManagementFully managedYou manage EC2Varies
ScalabilityAutomaticManualVaries
HABuilt-in (Multi-AZ)You configureVaries
S3 integrationNativeCustomCustom
CostPay per hourEC2 + storageVaries

Khi nào dùng Transfer Family?

Nên dùng:

  • Có partners/clients cần SFTP/FTP
  • Muốn migrate off self-managed FTP servers
  • Cần tích hợp với S3/EFS
  • Không muốn quản lý infrastructure

Không nên dùng:

  • Chỉ internal transfers (dùng S3 CLI/SDK)
  • Low volume, occasional transfers (cost cao)
  • Cần nhiều custom features (dùng self-managed)

Exam Tips

Khi đề bài nói:

  • "SFTP to S3"
  • "Partners upload files"
  • "Migrate FTP server to AWS"
  • "B2B EDI transactions" (AS2)

→ Nghĩ đến AWS Transfer Family


Liên kết

  • S3 - Storage backend chính
  • EFS - Alternative storage backend
  • VPC - VPC endpoints
  • Lambda - Custom identity provider
  • Direct Connect - On-premises connectivity