Skip to content

Monitor AWS Transfer Family events in your Slack channels with AWS Amazon Q Developer using Amazon EventBridge

5 minute read
Content level: Advanced
1

AWS Amazon Q Developer integrates with collaboration platforms like Slack to monitor AWS Transfer Family events. Slack can track file transfers directly from chat channels. This integration eliminates frequent application switching between AWS Console and chat platforms, enabling faster response to Transfer Family events.

In this blog post, I will share the steps for setting up an Amazon EventBridge rule and configuring AWS Amazon Q Developer to receive notifications in a Slack channel.

How It Works

Amazon EventBridge routes events from AWS services and other data sources to various destinations, such as Amazon Simple Notification Service (Amazon SNS) topics and AWS Lambda functions. To receive service event notifications in chat channels, configure an SNS topic as a target in the Amazon EventBridge rule and then associate the topic with a chat channel in the AWS Amazon Q Developer console. When EventBridge receives an event that matches the event pattern defined in the rule, the rule triggers, and the notification is sent to the configured chat channel.

In this tutorial, you will:

• Create an SNS topic.

• Configure an EventBridge rule for state change events.

• Create an AWS Amazon Q Developer configuration.

• Test the EventBridge rule.

Prerequisites

• A Transfer Family server.

• A Slack channel with the AWS Amazon Q Developer app installed.

Solution Walkthrough

This post demonstrates how to send AWS Transfer Family file transfer events to a Slack channel. For this blog, we will use AWS Transfer Family server events. With this solution, you will receive a notification in your Slack channels every time an SFTP users completes the upload or download of a file over your Transfer Family server endpoint.

Create an Amazon SNS topic

Note: If you already have an SNS topic, you can skip this step.

First, create an SNS topic to connect EventBridge with AWS Amazon Q Developer, 1. In the SNS console, choose Topics and then choose Create topic. 2. Provide a descriptive name for your topic and leave the other parameters at their default values.

Configure an Amazon EventBridge rule to respond to an event emitted by AWS Transfer Family server for a successful file upload or download

1. In the Amazon EventBridge console, choose Rules, and then choose Create Rule.

2. In Define rule detail, enter a name for your rule, select Next.

3. In the Build event pattern, select the options and select Next.

3.1. AWS Service - Transfer

3.2. Event type - FTP, FTPS, SFTP Server

3.3. Event Type Specification, select Specific event(s) and choose “SFTP Server File Upload Completed” and “SFTP Server File Download Completed”.

Note: It is not possible to customize which event details appear in Slack messages. Users cannot modify notification content, such as including specific file paths for uploads or downloads. However, EventBridge rules can be used to filter specific event patterns. For example, you can create rules to monitor successful SFTP downloads for specific usernames. For more information about configuring event patterns, refer to the documentation Creating event patterns for Transfer Family events.

Enter image description here

4. In the Select a target(s), select the options and select Next.

Target Types - AWS Service

Select a target - SNS Topic

Topic - Select a created or existing SNS Topic.

Enter image description here

5. In the Configuration tags, add tags, then select Next.

6. In Review and Create, review the EventBridge rule and select Create Rule.

Create an AWS Amazon Q Developer

1. In the AWS Amazon Q Developer console, choose Configure new client.

2. In Configure new client, select Slack. The setup wizard redirects you to the Slack OAuth 2.0

3. In the top-right corner, choose the Slack workspace you want to configure, then select Allow. The Slack workspace installs the AWSChatbot Slack app. The AWS account you used to sign in can now send notifications.

Enter image description here

4. In the Slack Workspace, choose Configure new channel.

• In Configuration details, enter a name.

• In Slack channel, enter the existing Slack channel ID or create a new one.

• In Channel role, “Create an IAM role using a template is selected by default. Enter a name in Role name.

• In Notifications - optional, select the region where the SNS Topic is configured and the SNS Topic name.

5. Scroll down and select Configure.

Add the AWS Amazon Q Developer to the Slack Channel

1. In the Slack Workspace, choose the channel where you want to receive the notifications. Make sure it matches the channel ID provided in the Chatbot configuration.

2. At the top of the channel, select to see all channel members.

3. Select the Integrations tab and choose Add and App.

Enter image description here

4. Search for AWS Amazon Q Developer App and select Add.

Enter image description here

Test Sending Transfer Family Events to the Slack Channel

To test this setup, use an SFTP client and connect to the Transfer Family server. Upload and download a file, then check the Slack channel for upload and download notifications.

Event1

Event2

Conclusion

By integrating AWS Transfer Family events with Slack using Amazon EventBridge and AWS Amazon Q Developer, IT Administrators can receive notifications directly in their Slack channels, keeping them informed about the status of important files in business processes. This integration monitoring enables teams to respond promptly to file uploads and downloads, ensuring that business operations remain uninterrupted and that data is handled securely and efficiently. By streamlining communication and reducing the need for frequent checks on the AWS Console. As a result, organizations can optimize their workflows, enhance productivity, and maintain a competitive edge in today's fast-paced digital landscape.