April 8, 2024
Implement AWS Transfer Family for Hybrid File Transfers
Transferring data between on-premises systems and the AWS cloud is a common need for many organizations. AWS Transfer Family provides a…

By Christopher Adamson
7 min read
Transferring data between on-premises systems and the AWS cloud is a common need for many organizations. AWS Transfer Family provides a fully managed service for securely exchanging files between an on-premises environment and Amazon S3 or Amazon EFS using standard protocols like FTP, FTPS, and SFTP.
In this tutorial, we will walk through how to implement AWS Transfer Family for seamless hybrid file transfers. We will cover setting up a Transfer Family server, configuring users, connecting from an on-premises system, automating file transfers on a schedule, processing transferred files with Lambda, monitoring transfer activity, and more.
AWS Transfer Family handles all of the undifferentiated heavy lifting of file transfers like encryption, network management, scaling, and redundancy. This allows you to focus on your file-based workflows while leaving the data transport to AWS. Transfer Family fits seamlessly into hybrid environments and replaces brittle self-managed file transfer systems.
By the end of this tutorial, you will have AWS Transfer Family configured for automated, secure file exchanges between on-premises and cloud. Data will flow between environments without manual effort, so you can build powerful hybrid applications and architectures. Let's get started with setting up a Transfer Family server.
Prerequisites
Before you can use AWS Transfer Family, you'll need:
- An AWS account
- An Amazon S3 bucket or Amazon EFS file system to transfer files to/from
- A server in your on-premises environment that can connect to AWS
The on-premises server must have an SSH server (for SFTP transfers) and/or FTP server (for FTP transfers) installed and configured.
Step 1 — Create an AWS Transfer Family Server
First, you'll need to create a Transfer Family server in AWS. This is the server that your on-premises systems will connect to for managed file transfers.
In the AWS Management Console, go to the Transfer Family service. Click "Create server" to launch the server creation workflow.
Choose the server type (SFTP, FTP, FTPS) based on the protocol your on-premises server uses.
Select the VPC and subnets for the server. Make sure to choose subnets that allow connectivity between your on-premises server and AWS.
Add any required tags and provide a server description.
For extra security, you can choose to store user credentials in AWS Secrets Manager rather than on the server directly.
Once the server is created, AWS will provision the resources and make the server address available.
Step 2 — Create Users
Next, you need to create Transfer Family users. These are the users that will be allowed to connect to your server from your on-premises environment.
In the Transfer Family console, select your server. Go to the Users section and click "Create user".
Provide user details like name, SSH public key for SFTP transfers or password for FTP.
Assign an IAM role to the user that allows read/write access to your S3 bucket or EFS filesystem.
Optionally enable PGP encryption of files using AWS Encryption SDK.
Repeat to create additional users as needed.
Step 3 — Connect from on-premises
Now you can connect to the Transfer Family server from your on-premises server and start transferring files!
For SFTP, connect using the server address, your username, and SSH private key.
For FTP, connect using the server address, username, and password.
Once connected, you can transfer files and automate transfers using your usual tools and scripts.
The Transfer Family service will handle secure connections, encryption, access controls, and auditing. All transfers will land in your S3 bucket or EFS file system.
Next Steps
Schedule and automate recurring file transfers
AWS Transfer Family makes it easy to schedule recurring transfers between your on-premises servers and S3/EFS.
In the Transfer Family console, go to "Workflow" to create an automated workflow.
Select the trigger type — you can schedule transfers to run on a cron schedule or trigger them based on events like file arrival.
Choose the source and destination servers along with the file transfer protocol.
Specify the file selection criteria — you can transfer entire directories or just files matching a pattern.
For recurrence, select the frequency and schedule for automated transfers. You can run them hourly, daily, weekly or monthly.
Configure any additional settings like overwriting existing files, preserving metadata etc.
Once created, the workflow will automatically handle transferring updated or new files based on the schedule.
You can view logs and metrics for your workflows within Transfer Family to monitor their status and transfer activity.
Automated workflows save time by managing recurring and repetitive transfers in a consistent, auditable way. You can define separate workflows for common tasks like:
- Hourly log file transfers
- Daily database backup transfer
- Weekly uploads of user home directories
- Monthly compliance document archival
By leveraging Transfer Family workflows, you can keep S3 or EFS continuously in sync with new data from your on-premises servers.
Streamline workflows using AWS Lambda functions
AWS Transfer Family integrates directly with Lambda to add serverless processing to your file transfers.
You can trigger a Lambda function in the following ways:
- On a per-file basis before or after transfer
- On a periodic schedule
- When new files arrive in an S3 bucket
In the Lambda function, you can:
- Manipulate transferred files, like unzipping compressed archives
- Initiate additional file processing after transfer
- Trigger notifications or other workflows
For example, you could automatically initiate a video encoding job in MediaConvert after new videos are transferred to S3.
Or notify administrators via email when log files arrive containing specific error strings.
Some common Lambda processing use cases include:
- Extracting metadata and generating thumbnails for images
- Transcoding media files after transfer
- Scanning new files for viruses or prohibited content
Lambda lets you efficiently streamline post-transfer processing and workflows directly within Transfer Family.
You avoid having to manually check for new transfers or move files to different systems for processing. This simplifies your architecture while unlocking the full power of serverless.
To add Lambda processing, create a function in Lambda and configure a trigger workflow in Transfer Family that invokes it. The function can then automate any follow-up tasks.
Set up notifications for transfers
AWS Transfer Family provides several options for configuring notifications when files are transferred.
You can set up notifications for:
- Individual file transfers
- Folder transfers
- Workflow job status
- Server events
To receive transfer notifications, first create an Amazon SNS topic. You can use SNS to send notifications via email, SMS text message, or to trigger other workflows.
For individual files, enable the "Send transfer status notifications" option when creating users. This will publish a notification to your SNS topic when file transfers succeed or fail.
For folders and workflows, you can configure transfer event notifications in the Transfer Family console. Choose the event types (success, failure, etc.) and specify the SNS topic.
For server events like user logins, enable CloudTrail logging on your Transfer Family server. Send CloudTrail events to an SNS topic to receive security notifications.
Notification messages include details like transfer IDs, filenames, statuses, error codes, and timestamps.
Benefits of transfer notifications:
- Alert administrators to transfer failures or errors
- Trigger automation when new files arrive
- Log activity for auditing and compliance
- Real-time visibility into file transfer workflows
With SNS and Transfer Family notifications, you can stay on top of critical file transfers and respond quickly to issues. Automated notifications keep your team informed and streamline post-transfer processing.
Analyze usage with CloudWatch metrics and logs
AWS Transfer Family provides CloudWatch metrics and logs that give visibility into your file transfers.
CloudWatch metrics let you monitor real-time statistics like:
- Files uploaded/downloaded per server
- Volume of data transferred
- Successful/failed transfer counts
- Latency for transfers
You can view graphs of metrics over time to analyze trends. Set up CloudWatch alarms to be notified when thresholds are crossed.
Transfer Family logs detailed events for each file and workflow. Logs include:
- Connection activity
- Transfer start/stop times
- Errors and exceptions
- User activity
Send logs to CloudWatch Logs or S3 for retention and analysis. Use CloudWatch Log Insights to search logs and generate visualizations.
Enable AWS CloudTrail to capture API calls made by Transfer Family. CloudTrail provides an audit trail of administrative activity.
Benefits of CloudWatch analytics:
- Monitor performance and usage
- Optimize transfer workflows
- Troubleshoot issues and errors
- Audit security and compliance
With CloudWatch, you gain full observability into your file transfer workflows. Analytics help optimize transfers, reduce costs, and strengthen security.
Consider setting up a CloudWatch dashboard to track key Transfer Family metrics and logs in one place. Share the dashboard to align teams on file transfer performance and activity.
AWS CLI Commands for Transfer Family
Here are some AWS CLI commands that can be used with AWS Transfer Family:
Create an SFTP server:
Create a user:
Create a workflow:
Describe a workflow:
List workflows:
Start a workflow:
Retrieve CloudWatch metrics:
This allows you to manage Transfer Family resources and workflows from the command line. You can also automate Transfer Family using the AWS CLI.
Conclusion
In this tutorial, we walked through implementing AWS Transfer Family for automated and secure file transfers between on-premises systems and AWS.
We covered creating a Transfer Family server, configuring user access, connecting from an on-premises server, scheduling recurring transfers, processing files with Lambda, monitoring with CloudWatch, and more.
With Transfer Family now set up, you have a managed file transfer service handling moving data between regions and environments. Files will flow seamlessly without manual effort thanks to automated workflows.
Your on-premises applications can now integrate with cloud capabilities by landing data directly into S3 or EFS. New serverless workflows can be built by processing files after transfer via Lambda.
The ability to move large datasets into AWS unlocks many use cases like cloud backup & restore, big data analytics, migration, and more. Transfer Family provides the transport layer to enable these hybrid scenarios.
As you saw, it only takes a few steps to get started with managed file transfers using Transfer Family. AWS handles the undifferentiated heavy lifting, so you can focus on your file transfer workflows and applications.
Now that you have access to data in the cloud, you can begin building powerful new hybrid architectures leveraging the full breadth of AWS services. The possibilities are endless when on-premises systems can securely exchange data with the cloud.