AS2 Protocol with Amazon S3 Integration
Jul 3, 2020 • Hirudinee Liyanage ~ 2 min to read

AS2 Protocol with Amazon S3 Integration

Integrating AWS S3 for EDI messages over AS2

MFT Gateway has made the exchange of your EDI files simple and easy. One-click integration with AWS S3 and you will be provided with a pair of AWS credentials. Using them you can connect your internal systems with the MFT Gateway to automate your AS2 Message flow in no time.

How to integrate the S3 bucket?

Login to the MFT Gateway console and click on the S3 integration from the left-hand side menu bar. Click on the Get Credential icon and then your access and secret key pair will be downloaded. MFT Gateway does not store your credentials, and keys can not be recovered if you lose them. So, save them somewhere safe. But in case you misplaced your current key pair, you can always disable them and generate a new pair of keys at any time.

Set up AWS S3 Integration on MFT Gateway

Access your s3 bucket through MFT Gateway

Where is my S3 Bucket?

When you create an account in MFT Gateway, an S3 bucket to store your keystores, AS2 messages, MDNs, and raw content is created in one of our AWS accounts. The bucket name is the name you gave as the tenant name plus an “mftg-” prefix.

For example, if your tenant name is mycompanyas2 your bucket name will be mftg-mycompanyas2.

Sending an EDI file

Once you have set up your station and partner, you can without logging in to the MFT Gateway console you can send your EDI files by uploading them to S3. MFT Gateway will pick them up from the S3 bucket and send them to your trading partner.

You have to upload your file to the S3 bucket under following prefix (path) :


For example, let’s say your station ID is ST01 and you have two partners PN01 and PN02. If you want to send invoice_220919.edi file to PN01 partner, then the corresponding AWS CLI command would be,

aws s3 cp /file/location/invoice_220919.edi s3://mftg-mycompanyas2/AS2 /send/ST01/PN01/

The file will be picked up and sent to the PN01 partner. Once the message is successfully sent it will be moved under a different prefix, and if required you can also list and download the sent files.


Received EDI files

All the received EDI files will be saved into your S3 bucket. These will have different name prefixes to group them by station IDs and partner IDs. A sample prefix would look like this:


If you receive an EDI file from PN02, you can list the received files Using AWS CLI command:

aws s3 ls s3://mftg-mycompanyas2/AS2/files/ST01/PN02/inbox/

And you can download them as well.

aws s3 cp s3://mftg-mycompanyas2/AS2/files/ST01/PN02/inbox/<timestamp- random-number>/attachment.edi

Using Your Own S3 bucket

MFT Gateway is a serverless product and it can be deployed as a dedicated installation in your AWS account as well. This way you will be able to use your own S3 buckets for the file exchange process. You can contact the MFTG team for further inquiries.