Managing Transfer Family events using Amazon EventBridge - AWS Transfer Family

Managing Transfer Family events using Amazon EventBridge

Amazon EventBridge is a serverless service that uses events to connect application components together, which can make it easier for you to build scalable event-driven applications. Event-driven architecture is a style of building loosely coupled software systems that work together by emitting and responding to events. Events represent a change in a resource or environment.

As with many AWS services, Transfer Family generates and sends events to the EventBridge default event bus. Note that the default event bus is automatically provisioned in every AWS account. An event bus is a router that receives events and delivers them to zero or more destinations, or targets. You specify rules for the event bus that evaluates events as they arrive. Each rule checks whether an event matches the rule's event pattern. If the event matches, the event bus sends the event to one or more specified targets.

AWS services send events to the EventBridge default event bus. If the event matches a rule's event pattern, EventBridge sends the event to the targets specified for that rule.

Transfer Family events

Transfer Family automatically sends events to the default EventBridge event bus. You can create rules on the event bus where each rule includes an event pattern and one or more targets. Events that match a rule's event pattern are delivered to the specified targets on a best effort basis, however, some events might be delivered out of order.

The following events are generated by Transfer Family. For more information, see EventBridge events in the Amazon EventBridge User Guide.

SFTP, FTPS, and FTP server events

Event detail type Description

FTP File Server Download Completed

A file has been downloaded successfully for the FTP protocol.

FTP File Server Download Failed

An attempt to download a file has failed for the FTP protocol.

FTP File Server Upload Completed

A file has been uploaded successfully for the FTP protocol.

FTP File Server Upload Failed

An attempt to upload a file has failed for the FTP protocol.

FTPS File Server Download Completed

A file has been downloaded successfully for the FTPS protocol.

FTPS File Server Download Failed

An attempt to download a file has failed for the FTPS protocol.

FTPS File Server Upload Completed

A file has been uploaded successfully for the FTPS protocol.

FTPS File Server Upload Failed

An attempt to upload a file has failed for the FTPS protocol.

SFTP Server File Download Completed

A file has been downloaded successfully for the SFTP protocol.

SFTP Server File Download Failed

An attempt to download a file has failed for the SFTP protocol.

SFTP Server File Upload Completed

A file has been uploaded successfully for the SFTP protocol.

SFTP Server File Upload Failed

An attempt to upload a file has failed for the SFTP protocol.

SFTP connector events

Event detail type Description

SFTP Connector File Send Completed

A file transfer from a connector to a remote SFTP server has completed successfully.

SFTP Connector File Send Failed

A file transfer from a connector to a remote SFTP server has failed.

SFTP Connector File Retrieve Completed

A file transfer from a remote SFTP server to a connector has completed successfully.

SFTP Connector File Retrieve Failed

A file transfer from a remote SFTP server to a connector has failed.

SFTP Connector Directory Listing Completed

A start file directory listing call that has completed successfully.

SFTP Connector Directory Listing Failed

A start file directory listing that has failed.

A2S events

Event detail type Description

AS2 Payload Receive Completed

The payload for an AS2 message has been received.

AS2 Payload Receive Failed

The payload for an AS2 message has not been received.

AS2 Payload Send Completed

The payload for an AS2 message has been sent successfully.

AS2 Payload Send Failed

The payload for an AS2 message has failed to send.

AS2 MDN Receive Completed

The message disposition notification for an AS2 message has been received.

AS2 MDN Receive Failed

The message disposition notification for an AS2 message has not been received.

AS2 MDN Send Completed

The message disposition notification for an AS2 message has been sent successfully.

AS2 MDN Send Failed

The message disposition notification for an AS2 message has failed to send.

Sending Transfer Family events by using EventBridge rules

If you want the EventBridge default event bus to send Transfer Family events to a target, you must create a rule that contains an event pattern that matches the data in your desired Transfer Family events.

You can create a rule by following these general steps:

  1. Create an event pattern for the rule that specifies the following:

    • Transfer Family is the source of events being evaluated by the rule.

    • (Optional) Any other event data to match it against.

    For more information, see Creating event patterns for Transfer Family events.

  2. (Optional) Create an input transformer that customizes the data from the event before EventBridge sends the information to the target of the rule.

    For more information, see Input transformation in the EventBridge User Guide.

  3. Specify the targets to which you want EventBridge to deliver events that match the event pattern.

    Targets can be other AWS services, software as a service (SaaS) applications, API destinations, or other custom endpoints. For more information, see Targets in the EventBridge User Guide.

For comprehensive instructions on creating event bus rules, see Creating rules that react to events in the EventBridge User Guide.

Creating event patterns for Transfer Family events

When Transfer Family delivers an event to the default event bus, EventBridge uses the event pattern defined for each rule to determine if the event should be delivered to the rule's targets. An event pattern matches the data in the desired Transfer Family events. Each event pattern is a JSON object that contains the following:

  • A source attribute that identifies the service sending the event. For Transfer Family events, the source is aws.transfer.

  • (Optional) A detail-type attribute that contains an array of the event types to match.

  • (Optional) A detail attribute containing any other event data on which to match.

For example, the following event pattern matches against all events from Transfer Family:

{ "source": ["aws.transfer"] }

The following event pattern example matches all of the SFTP connector events:

{ "source": ["aws.transfer"], "detail-type": ["SFTP Connector File Send Completed", "SFTP Connector File Retrieve Completed", "SFTP Connector File Retrieve Failed", "SFTP Connector File Send Failed"] }

The following event pattern example matches all Transfer Family failed events:

{ "source": ["aws.transfer"], "detail-type": [{"wildcard", "*Failed"}] }

The following event pattern example matches successful SFTP downloads for user username:

{ "source": ["aws.transfer"], "detail-type": ["SFTP Server File Download Completed"], "detail": { "username": [username] } }

For more information on writing event patterns, see Event patterns in the EventBridge User Guide.

Testing event patterns for Transfer Family events in EventBridge

You can use the EventBridge Sandbox to quickly define and test an event pattern, without having to complete the broader process of creating or editing a rule. Using the Sandbox, you can define an event pattern and use a sample event to confirm that the pattern matches the desired events. EventBridge gives you the option of creating a new rule by using that event pattern directly from the sandbox.

For more information, see Testing an event pattern using the EventBridge Sandbox in the EventBridge User Guide.

Amazon EventBridge permissions

Transfer Family doesn't require any additional permissions to deliver events to Amazon EventBridge.

The targets that you specify might require specific permissions or configuration. For more details on using specific services for targets, see Amazon EventBridge targets in the Amazon EventBridge User Guide.

Additional EventBridge resources

Refer to the following topics in the Amazon EventBridge User Guide for more information on how to use EventBridge to process and manage events.

  • For detailed information on how event buses work, see Amazon EventBridge event bus.

  • For information on event structure, see Events.

  • For information on constructing event patterns for EventBridge to use when matching events against rules, see Event patterns.

  • For information on creating rules to specify which events EventBridge processes, see Rules.

  • For information on how to specify what services or other destinations to which EventBridge sends matched events, see Targets.