SFTP connector events - AWS Transfer Family

SFTP connector events

The following are the detail fields for SFTP connector events:

  • SFTP Connector File Send Completed

  • SFTP Connector File Send Failed

  • SFTP Connector File Retrieve Completed

  • SFTP Connector File Retrieve Failed

  • SFTP Connector Directory Listing Completed

  • SFTP Connector Directory Listing Failed

The source and detail-type fields are included below because they contain specific values for Transfer Family events. For definitions of the other metadata fields that are included in all events, see Event structure reference in the Amazon EventBridge User Guide.

{ . . ., "detail-type": "string", "source": "aws.transfer", . . ., "detail": { "operation" : "string", "max-items" : "number", "connector-id" : "string", "output-directory-path" : "string", "listing-id" : "string", "transfer-id" : "string", "file-transfer-id" : "string", "url" : "string", "file-path" : "string", "status-code" : "string", "failure-code" : "string", "failure-message" : "string", "start-timestamp" : "string", "end-timestamp" : "string", "local-directory-path" : "string", "remote-directory-path" : "string" "item-count" : "number" "truncated" : "boolean" "bytes" : "number", "local-file-location" : { "domain" : "string", "bucket" : "string", "key" : "string" }, "output-file-location" : { "domain" : "string", "bucket" : "string", "key" : "string" } } }
detail-type

Identifies the type of event.

For this event, the value is one of the SFTP connector event names listed previously.

source

Identifies the service that generated the event. For Transfer Family events, this value is aws.transfer.

detail

A JSON object that contains information about the event. The service that generates the event determines the content of this field.

For this event, the data includes the following:

max-items

The maximum number of directory/file names to return.

operation

Whether the StartFileTransfer request is sending or retrieving a file. Values: SEND|RETRIEVE.

connector-id

The unique identifier for the SFTP connector being used.

output-directory-path

The path (bucket and prefix) in Amazon S3 to store the results of the file/directory listing.

listing-id

A unique identifier for the StartDirectoryListing API call. This identifier can be used to check CloudWatch logs to see the status of listing request.

transfer-id

The unique identifier for the transfer event (a StartFileTransfer request).

file-transfer-id

The unique identifier for the file being transferred.

url

The URL of the partner's AS2 or SFTP endpoint.

file-path

The location and file that is being sent or retrieved.

status-code

Whether the transfer is successful. Values: FAILED | COMPLETED.

failure-code

For failed transfers, the reason code for why the transfer failed.

failure-message

For failed transfers, the details for why the transfer failed.

start-timestamp

For successful transfers, the timestamp for when file processing begins.

end-timestamp

For successful transfers, the timestamp for when file processing completes.

local-directory-path

For RETRIEVE requests, the location in which to place the retrieved file.

remote-directory-path

For SEND requests, the file directory in which to place the file on the partner's SFTP server. This is the value for the RemoteDirectoryPath that the user passed to the StartFileTransfer request. You can specify a default directory on the partner's SFTP server. If so, this field is empty.

item-count

The number of items (directories and files) returned for the listing request.

truncated

Whether the list output contains all of the items contained in the remote directory or not.

bytes

The number of bytes being transferred. The value is 0 for failed transfers.

local-file-location

This parameter contains the details of the location of the AWS storage file.

domain

The storage being used. Currently, the only value is S3.

bucket

The container for the object in Amazon S3.

key

The name assigned to the object in Amazon S3.

output-file-location

This parameter contains the details of the location for where to store the results of the directory listing in AWS storage.

domain

The storage being used. Currently, the only value is S3.

bucket

The container for the object in Amazon S3.

key

The name assigned to the object in Amazon S3.

Example SFTP Connector File Send Failed example event

The following example shows an event where an SFTP connector failed while trying to send a file to a remote SFTP server.

{ "version": "0", "id": "event-ID", "detail-type": "SFTP Connector File Send Failed", "source": "aws.transfer", "account": "123456789012", "time": "2024-01-24T19:30:45Z", "region": "us-east-1", "resources": [ "arn:aws:transfer:us-east-1:123456789012:connector/c-f1111aaaa2222bbbb3" ], "detail": { "operation": "SEND", "connector-id": "c-f1111aaaa2222bbbb3", "transfer-id": "transfer-ID", "file-transfer-id": "file-transfer-ID", "url": "sftp://s-21a23456789012a.server.transfer.us-east-1.amazonaws.com", "file-path": "/DOC-EXAMPLE-BUCKET/testfile.txt", "status-code": "FAILED", "failure-code": "CONNECTION_ERROR", "failure-message": "Unknown Host", "remote-directory-path": "", "bytes": 0, "start-timestamp": "2024-01-24T18:29:33.658729Z", "end-timestamp": "2024-01-24T18:29:33.993196Z", "local-file-location": { "domain": "S3", "bucket": "DOC-EXAMPLE-BUCKET", "key": "testfile.txt" } } }
Example SFTP Connector File Retrieve Completed example event

The following example shows an event where an SFTP connector successfully retrieved a file sent from a remote SFTP server.

{ "version": "0", "id": "event-ID", "detail-type": "SFTP Connector File Retrieve Completed", "source": "aws.transfer", "account": "123456789012", "time": "2024-01-24T18:28:08Z", "region": "us-east-1", "resources": [ "arn:aws:transfer:us-east-1:123456789012:connector/c-f1111aaaa2222bbbb3" ], "detail": { "operation": "RETRIEVE", "connector-id": "c-fc68000012345aa18", "transfer-id": "file-transfer-ID", "file-transfer-id": "file-transfer-ID", "url": "sftp://s-21a23456789012a.server.transfer.us-east-1.amazonaws.com", "file-path": "testfile.txt", "status-code": "COMPLETED", "local-directory-path": "/DOC-EXAMPLE-BUCKET", "bytes": 63533, "start-timestamp": "2024-01-24T18:28:07.632388Z", "end-timestamp": "2024-01-24T18:28:07.774898Z", "local-file-location": { "domain": "S3", "bucket": "DOC-EXAMPLE-BUCKET", "key": "testfile.txt" } } }
Example SFTP Connector Directory Listing Completed example event

The following example shows an event where a start directory listing call retrieved a listing file from a remote SFTP server.

{ "version": "0", "id": "event-ID", "detail-type": "SFTP Connector Directory Listing Completed", "source": "aws.transfer", "account": "123456789012", "time": "2024-01-24T18:28:08Z", "region": "us-east-1", "resources": [ "arn:aws:transfer:us-east-1:123456789012:connector/c-f1111aaaa2222bbbb3" ], "detail": { "max-items": 10000, "connector-id": "c-fc68000012345aa18", "output-directory-path": "/DOC-EXAMPLE-BUCKET/example/file-listing-output", "listing-id": "123456-23aa-7980-abc1-1a2b3c4d5e", "url": "sftp://s-21a23456789012a.server.transfer.us-east-1.amazonaws.com", "status-code": "COMPLETED", "remote-directory-path": "/home", "item-count": 10000, "truncated": true, "start-timestamp": "2024-01-24T18:28:07.632388Z", "end-timestamp": "2024-01-24T18:28:07.774898Z", "output-file-location": { "domain": "S3", "bucket": "DOC-EXAMPLE-BUCKET", "key": "c-fc1ab90fd0d047e7a-70987273-49nn-4006-bab1-1a7290cc412ba.json" } } }