Overview
This project automates the transfer of email attachments from Microsoft Outlook to Amazon S3. Power Automate monitors an Outlook folder, extracts each attachment and writes it through SFTP to an AWS Transfer Family endpoint backed by an S3 bucket.
The pattern is useful when a team receives operational files by email but needs them in object storage for analytics, archiving or downstream processing. A similar flow can use SharePoint as the source.
Implementation note: I originally built this project in 2022, so some console screens may have changed. Review the current AWS Transfer Family user documentation and Microsoft SFTP-SSH connector documentation before deploying it. Keep SSH host-key validation enabled and apply least-privilege access throughout.
Architecture
The workflow separates file ingestion from storage:
- Outlook receives an email with one or more attachments.
- A Power Automate cloud flow extracts each attachment.
- The SFTP-SSH connector sends the file to an AWS Transfer Family endpoint.
- AWS Transfer Family writes the file into the selected Amazon S3 bucket.
- Services downstream of S3 can validate, catalogue, archive or process the object.
The implementation has six stages: create the bucket, define IAM access, create the Transfer Family server, add a user, test SFTP and build the Power Automate flow.
1. Create the Amazon S3 bucket
- Open the Amazon S3 console and choose Create bucket.
- Enter a globally unique, DNS-compliant bucket name.
- Select the AWS Region in which the files should reside.
- Keep ACLs disabled under Object Ownership.
- Keep Block Public Access enabled unless a separate, reviewed requirement says otherwise.
- Configure default encryption, versioning, lifecycle rules and tags according to your environment.
- Choose Create bucket.

2. Create the IAM role and bucket policy
AWS Transfer Family assumes an IAM role when the service-managed user accesses Amazon S3.
- Open the IAM console and choose Create role.
- Select AWS service as the trusted entity.
- Choose Transfer as the service or use case.

Do not attach AmazonS3FullAccess. Create a policy limited to the destination bucket and to the operations required by this workflow. The following example permits bucket discovery for that one bucket and common read, write, delete and multipart-upload operations:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BucketAccess",
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket",
"s3:ListBucketMultipartUploads"
],
"Resource": "arn:aws:s3:::[s3-bucket-name]"
},
{
"Sid": "ObjectAccess",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Resource": "arn:aws:s3:::[s3-bucket-name]/*"
}
]
}
Replace [s3-bucket-name] with the bucket created in the previous step. Remove GetObject, DeleteObject or any other action that your workflow does not need. You can also restrict access to a prefix rather than the entire bucket.

Name and create the policy, return to the role workflow, refresh the policy list and attach the new policy. Give the role a clear name before creating it.

3. Create the SFTP server
- Open the AWS Transfer Family console and choose Create server.
- Select SFTP as the protocol.
- Choose Service managed as the identity provider for this implementation.
- Select an endpoint type that Power Automate can reach. The original implementation used a publicly accessible endpoint. Review current network, firewall and logging requirements before using that option in production.
- Select Amazon S3 as the storage domain.
- Configure a CloudWatch logging role so connection and transfer activity can be investigated.
- Optionally associate a custom hostname through Amazon Route 53.
- Create the server and wait until its status becomes available.

4. Add a service-managed user
Open the server and choose Add user.

Configure:
- A username dedicated to the integration.
- The IAM role created for access to the destination bucket.
- The bucket or prefix that should be used as the user’s home directory.

The user authenticates with an SSH key pair. Generate a dedicated key according to the AWS Transfer Family SSH key guidance. The original implementation used PuTTY Key Generator.

Store both files securely. Never share the private key, and protect it with a passphrase where the connector and your operational process support one. Paste only the public key into the Transfer Family user’s Public key field, then create the user.
5. Test the SFTP connection
Test the endpoint with an SFTP client before introducing Power Automate. The original implementation used WinSCP.
Create a new SFTP session with:
- Host name: the custom hostname, or the Transfer Family endpoint in the form
[server-id].server.transfer.[region-id].amazonaws.com - Port:
22 - User name: the service-managed username
- Private key: the private half of the key pair

In WinSCP, open Advanced → SSH → Authentication and select the PPK private-key file. Verify the server fingerprint shown on first connection against a value obtained through a trusted channel before accepting it.
Upload, download and remove a test object within the permitted home directory. Confirm that the object appears at the expected S3 key and that the user cannot leave the intended bucket or prefix.

At this point the AWS side contains the S3 bucket, IAM role and policy, Transfer Family server, service-managed user and SSH key pair.
6. Build the Power Automate flow
Power Automate provides the Outlook trigger and the SFTP-SSH action that connect the two platforms. Some screenshots from the original implementation display the product’s former Microsoft Flow branding.

Choose Create → Automated cloud flow, enter a flow name and select When a new email arrives as the trigger.

Configure the Outlook folder that the trigger should monitor. A dedicated folder works well when an Outlook rule first filters messages by sender, subject or another business condition.

Add an Apply to each control and use the message’s Attachments collection as its input.

Inside the loop, add the Create file (SFTP-SSH) action.

Use the same host, port and username verified with WinSCP. The connector expects a supported OpenSSH or PEM private-key format. If the key was generated in PuTTY’s PPK format, load it into PuTTY Key Generator and export an OpenSSH key.

Copy the complete private key into the connector, including its opening and closing lines. If the key is protected, provide its passphrase through the secure passphrase field.
Keep Disable SSH host key validation turned off. Enter the server’s verified fingerprint in SSH host key fingerprint so the connector rejects a server whose host key does not match the expected value.

Configure the action fields:
- Folder path: the destination folder under the user’s SFTP home directory
- File name: the current attachment’s name
- File content: the current attachment’s content

Save and test the flow by sending an email with an attachment that matches the trigger conditions. If the object does not arrive, review the Power Automate run history, Transfer Family logs and destination path before broadening permissions.
Extending the pattern
The source does not have to be Outlook. The same design can begin with SharePoint and use the When a file is created or modified trigger before sending the file through the SFTP connector.

After a file reaches Amazon S3, the pipeline can continue with event notifications, schema validation, malware scanning, cataloguing, archiving or downstream data processing.
The security guidance in this case study was refreshed against the AWS and Microsoft documentation linked above.
