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.
Topics
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 |
---|---|
A file has been downloaded successfully for the FTP protocol. |
|
An attempt to download a file has failed for the FTP protocol. |
|
A file has been uploaded successfully for the FTP protocol. |
|
An attempt to upload a file has failed for the FTP protocol. |
|
A file has been downloaded successfully for the FTPS protocol. |
|
An attempt to download a file has failed for the FTPS protocol. |
|
A file has been uploaded successfully for the FTPS protocol. |
|
An attempt to upload a file has failed for the FTPS protocol. |
|
A file has been downloaded successfully for the SFTP protocol. |
|
An attempt to download a file has failed for the SFTP protocol. |
|
A file has been uploaded successfully for the SFTP protocol. |
|
An attempt to upload a file has failed for the SFTP protocol. |
SFTP connector events
Event detail type | Description |
---|---|
A file transfer from a connector to a remote SFTP server has completed successfully. | |
A file transfer from a connector to a remote SFTP server has failed. | |
A file transfer from a remote SFTP server to a connector has completed successfully. | |
A file transfer from a remote SFTP server to a connector has failed. | |
A start file directory listing call that has completed successfully. | |
A start file directory listing that has failed. |
AS2 events
Event detail type | Description |
---|---|
The payload for an AS2 message has been received. | |
The payload for an AS2 message has not been received. | |
The payload for an AS2 message has been sent successfully. | |
The payload for an AS2 message has failed to send. | |
The message disposition notification for an AS2 message has been received. | |
The message disposition notification for an AS2 message has not been received. | |
The message disposition notification for an AS2 message has been sent successfully. | |
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:
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.
(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.
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 isaws.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.