How To Transfer Files To S3 Buckets Using SFTP and FTP

Cover image

Deploying, setting up and configuring the S3 File Transfer Server is super quick and easy. Just follow these steps.

  1. To begin, you will first need to deploy the S3 File Transfer Server from the AWS Marketplace.
  2. Next, configure tags on the EC2 instance. The tag name should be "Buckets" and the value should be one or more S3 bucket names that will be used for file transfers.

  3. Next, in IAM, create a new policy called S3-File-Transfer-Server-Policy. In this policy, paste the following JSON:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1473154086000",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeTags"
            ],
            "Resource": [
                "*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:AbortMultipartUpload",
                "s3:DeleteObject",
                "s3:GetObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::*/*"
        }
    ]
}
  1. Now, create an IAM role called S3-FileTransfer-Server-Role and attach the S3-File-Transfer-Server-Policy that we just created.

  2. Next, modify the role of the EC2 instance so it has the S3-File-Transfer-Server-Role attached to it.

  3. Finally, now that the role has been created and attached to the EC2 instance, we just need to reboot the appliance.

7. And that's it! Now, you can now SFTP into the server: