惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News
H
Help Net Security
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
Martin Fowler
Martin Fowler
T
Troy Hunt's Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
S
Secure Thoughts
Y
Y Combinator Blog
D
Docker
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
N
News and Events Feed by Topic
aimingoo的专栏
aimingoo的专栏
I
InfoQ
P
Palo Alto Networks Blog
F
Full Disclosure
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Heimdal Security Blog
G
Google Developers Blog
Webroot Blog
Webroot Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
W
WeLiveSecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
The Last Watchdog
The Last Watchdog
TaoSecurity Blog
TaoSecurity Blog
博客园 - 三生石上(FineUI控件)
T
Threatpost
V
V2EX
AWS News Blog
AWS News Blog
O
OpenAI News
V
Visual Studio Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Cross-region data transfer from NFS server to Amazon EFS file system using AWS DataSync
Mawuli Dente · 2026-04-28 · via DEV Community

Overview

This AWS DataSync solution transfers data from an EC2-hosted NFS share in VPC A (us-east-1) to an Amazon EFS file system in VPC B (us-west-2). The two VPCs are connected through a peering connection. This setup simulates a typical on-premises to cloud data migration scenario.

An NFS server uses the NFS protocol to share files and directories over a network.

Amazon EFS is a fully managed, serverless cloud file storage service that provides elastic, shared file storage for Linux-based workloads and applications running on AWS services like EC2.

AWS DataSync, a fully managed, high-speed data transfer service, communicates with both storage locations via VPC endpoints, utilizing a private, fast and secure connection to accomplish the transfer.

VPC Endpoints provide private interface entry points to AWS services from within a VPC. While many AWS services have public endpoints that can be accessed over the internet, it is a best practice to use VPC endpoints to communicate with AWS services securely from within a VPC.

Architecture Diagram

extra-large Architecture diagram

US-EAST-1

VPC A

  1. Create a VPC A in us-east-1 with 10.0.0.0/16 Cidr.
  2. Create two public subnets and an internet gateway.
  3. Create two private subnets and a nat gateway.
  4. Create an SSM Endpoint security group with the following rules:
    1. Inbound: 
      1. HTTPS from VPC A.
    2. Outbound
      1. All traffic to VPC A.
  5. Set up SSM Default Host Management Configuration to enable Session Manager to access the NFS server. You can optionally use a bastion host to access the NFS server.
  6. Use the default Host Management role or create and attach an EC2 role to the NFS server for session manager to work. Attach the following AWS managed policies to the EC2 role:
    1. AmazonSSMManagedEC2InstanceDefaultPolicy
    2. AmazonSSMManagedInstanceCore

extra-large Architecture diagram

VPC A Endpoints

Create a VPC endpoint each for SSMEC2-Messages, and SSM-Messages as follows:

  1. Create endpoint.
  2. Optional name.
  3. Choose “AWS services” type.
  4. Type “ssm” and search.
  5. Select the first option com.amazonaws.us-east-1.ssm. The name varies according to the service.
  6. Next, select VPC A.
  7. Check “Enable private DNS name”.
  8. DNS record IP type: IPv4.
  9. Subnets. Check the first two Availability Zones in the list. Under Subnet ID, select both private subnets.
  10. IP address type: IPv4.
  11. Security groups: Use the SSM Endpoint Security Group created earlier. You will use this security group for all VPC endpoints in region A.
  12. Policy: Full access.

extra-large Architecture diagram

NFS Server

Create the NFS server with the following specifications:

  1. Launch instances.
  2. Amazon Linux AMI.
  3. t2.micro instance type.
  4. Proceed without a key pair.
  5. PrivateSubnetA.
  6. Auto-assign public IP disabled.
  7. Create NFS server security group:
    1. Inbound: 
      1. HTTPS from SSM Endpoint.
      2. NFS from VPC B.
      3. ICMP from VPC B.
    2. Outbound
      1. All traffic to VPC A and B.
  8. 8 GB gp3 EBS volume.
  9. User data for NFS server. Creates and exports NFS share, generates files for the transfer.

#!/bin/bash
set -e
sleep 180
# Check if the secondary drive exists
if ! lsblk /dev/xvdb &>/dev/null; then
    echo “/dev/xvdb not found. Exiting.”
    exit 1
fi

mkfs.ext4 /dev/xvdb
mkdir -p /mnt/data
mount /dev/xvdb /mnt/data
echo ‘/dev/xvdb /mnt/data ext4 defaults,nofail 0 2’ | sudo tee -a /etc/fstab

# Create and set up NFS share directory
TARGET_DIR=”/mnt/data/nfs_share”
PREFIX=”test”
EXT=”.txt”
mkdir -p $TARGET_DIR
chown -R nobody:nobody $TARGET_DIR
chmod 777 $TARGET_DIR

# Function to generate files
generate_files() {
local start=$1
local end=$2
local size_range=$3
local block_size=$4
local group_label=$5

local start_time=$(date +%s)
echo “Starting generation of $group_label at $(date)for i in $(seq -f “%04g” $start $end); do
    FILE=${TARGET_DIR}/${PREFIX}${i}${EXT}SIZE=$((RANDOM % size_range + 1))
    dd if=/dev/urandom of=$FILEbs=$block_size count=$SIZE status=none &
done
wait

local end_time=$(date +%s)
echo “Finished generation of $group_label at $(date)local elapsed_time=$((end_time - start_time))
echo “Time taken for $group_label: ${elapsed_time} seconds”
}

# Generate file groups with time tracking
generate_files 1 1000 100 1K “1000 files (1KB to 100KB)” &
generate_files 1001 1100 100 1M “100 files (1MB to 100MB)” &

wait
echo “File generation complete in $TARGET_DIRsed -i\|^$TARGET_DIR |d” /etc/exports
echo$TARGET_DIR *(rw,sync,no_root_squash,no_all_squash)” | sudo tee -a /etc/exports > /dev/null
systemctl start nfs-server
systemctl enable nfs-server
exportfs -rav

Enter fullscreen mode Exit fullscreen mode

Verify that you can connect to the NFS server via Session Manager.

US-WEST-2

VPC B

  1. Create a target VPC in us-west-2 with 172.31.0.0/16 Cidr.
  2. Create two public subnets and an internet gateway.
  3. Create two private subnets and a NAT gateway.
  4. Follow the same steps as in Region A to enable Session Manager to access the NFS client.
  5. Create and attach an SSM Endpoint Security Group to all the endpoints:

    1. Inbound: 
      1. HTTPS from DataSync agent.
      2. NFS from VPC B.
      3. 1024 – 1064 from DataSync agent.
    2. Outbound
      1. All traffic to VPC B.
  6. Attach the same EC2 role created from VPC A to the NFS client if you are in the same account. For different accounts, you need to create a new EC2 role for the NFS client.

  7. Create and attach an EC2 role to the DataSync agent. Attach the following AWS managed policies to the role:

    1. AWSDataSyncFullAccess
    2. AmazonSSMManagedEC2InstanceDefaultPolicy
    3. AmazonSSMManagedInstanceCore

DataSync Agent

Create the DataSync agent using the specifications below:

  1. DataSync latest AMI.
  2. t3.micro instance type.
  3. Proceed without a key pair.
  4. PrivateSubnetA.
  5. Auto-assign public IP disabled.
  6. Create a DataSync agent security group as follows:
    1. Inbound: 
      1. HTTPS from VPC B.
      2. HTTP from NFS client.
      3. ICMP from NFS client.
    2. Outbound
      1. All traffic to VPC A and B.
  7. 20 GB gp3 EBS volume.

VPC B Endpoints

Follow similar procedures from US-EAST-1 to create VPC endpoints for:

  1. SSM.
  2. EC2-Messages.
  3. SSM-Messages.
  4. EFS.
  5. DataSync.

extra-large Architecture diagram

NFS Client

Create the NFS client EC2 as shown below:

  1. Launch instances.
  2. Amazon Linux AMI.
  3. t2.micro instance type.
  4. Proceed without a key pair.
  5. PrivateSubnetA.
  6. Create an NFS client security group:
    1. Inbound: 
      1. HTTPS from VPC B.
    2. Outbound
      1. All traffic to VPC A and B.
  7. 8 GB gp3 EBS volume.

EFS file system

  1. Create an EFS Security Group with the following rules:
    1. Inbound: 
      1. NFS traffic from VPC B.
      2. NFS traffic from NFS Client.
      3. NFS traffic from DataSync agent. 
      4. NFS traffic from SSM Endpoint.
      5. HTTPS from VPC B and SSM Endpoint.
      6. ICMP from NFS client.
    2. Outbound
      1. All traffic to VPC B.
  2. Create file system.
  3. Select the target VPC.
  4. Keep the recommended settings and Create file system.
  5. Click on the file system ID.
  6. Go to the Network tab.
  7. Manage.
  8. For the two mount points, edit the security groups to use only the earlier created EFS Security Group.

VPC Peering

  1. Create peering connection.
  2. Optional name.
  3. VPC ID (Requester): VPC A ID.
  4. Select another VPC to peer with: My account.
  5. Region: Another Region.
  6. VPC ID (Accepter): VPC B ID.

extra-large Architecture diagram

  1. From Region B (us-west-2) Peering Connections, select the peering connection available.
  2. From the “Actions” menu, Accept request. Confirm.

extra-large Architecture diagram

  1. Update the private route table for VPC A to forward Region B traffic to the peering connection.

extra-large Architecture diagram

  1. Update the private route table for VPC B to forward Region A traffic to the peering connection.

extra-large Architecture diagram

Systems Setup

Mount the NFS share

Connect to the NFS client via Session Manager.
Mount the NFS share from the NFS client over the peering connection.

# Ping the NFS server to verify connection
ping -c 5 10.0.x.x

# Mount NFS server
sudo mkdir -p /mnt/nfs
sudo mount -t nfs 10.0.x.x:/mnt/data/nfs_share /mnt/nfs -o rw,sync

Enter fullscreen mode Exit fullscreen mode

extra-large Architecture diagram

extra-large Architecture diagram

Mount the EFS file system

Mount the EFS file system from the NFS client.

# Mount EFS file system
sudo mkdir -p /mnt/efs

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-xxxxxxxxxxxxxxx.efs.us-west-2.amazonaws.com:/ /mnt/efs
OR
sudo mount -t nfs4 -o sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 172.31.x.x:/ /mnt/efs

Enter fullscreen mode Exit fullscreen mode

extra-large Architecture diagram

DataSync agent

Obtain the activation code of the DataSync agent from the NFS client.

# Test connectivity to the agent
nc -vz 172.31.x.x 80 

# Obtain activation code
sudo curl “http://<datasync-agent-ip>/?gatewayType=SYNC&activationRegion=us-west-2&privateLinkEndpoint=<datasync-vpce-ip>&endpointType=PRIVATE_LINK&no_redirect”

# NB: Replace <datasync-agent-ip> and <datasync-vpce-ip> with actual values

Enter fullscreen mode Exit fullscreen mode

Activate the DataSync agent using the activation key.

aws datasync create-agent \
    --agent-name “datasync-agent” \
    --activation-key “xxxxx-xxxxx-xxxxx-xxxxx-xxxxx” \
    --vpc-endpoint-id “vpce-xxxxxxxxxxxxxxxxx” \
    --subnet-arns “arn:aws:ec2:us-west-2:accountId:subnet/subnet-xxxxxxxxxxx” \
    --security-group-arns “arn:aws:ec2:us-west-2:accountId:security-group/sg-xxxxxxxxxxxx”

Enter fullscreen mode Exit fullscreen mode

Create the NFS location.

aws datasync create-location-nfs \
    --server-hostname “10.0.x.x” \
    --subdirectory “/mnt/data/nfs_share” \
    --on-prem-config AgentArns=”arn:aws:datasync:us-west-2:accountId:agent/agent-xxxxxxxxxxx”

Enter fullscreen mode Exit fullscreen mode

Create the EFS location.

aws datasync create-location-efs \
    --efs-filesystem-arn “arn:aws:elasticfilesystem:us-west-2:accountId:file-system/fs-xxxxxxxxxxxxx” \
    --ec2-config SubnetArn=”arn:aws:ec2:us-west-2:accountId:subnet/subnet-xxxxxxxxxxxxx”,SecurityGroupArns=”arn:aws:ec2:us-west-2:accountId:security-group/sg-xxxxxxxxxxxxxxx”

Enter fullscreen mode Exit fullscreen mode

Create a task that connects both locations and start the task.

aws datasync create-task \
    --source-location-arn “arn:aws:datasync:us-west-2:accountId:location/loc-xxxxxxxxxxxxxx” \
    --destination-location-arn “arn:aws:datasync:us-west-2:accountId:location/loc-xxxxxxxxxxxxxx”

Enter fullscreen mode Exit fullscreen mode

extra-large Architecture diagram

YouTube Tutorial

References

  1. https://docs.aws.amazon.com/datasync/latest/userguide/what-is-datasync.html.
  2. https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html.
  3. https://docs.aws.amazon.com/systems-manager/latest/userguide/fleet-manager-default-host-management-configuration.html.
  4. https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html.
  5. https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html.