0

I'm facing a challenge with the configuration of the AWS Transfer Family. I have multiple Lambda functions (such as b1 and b2) and would like each one to be invoked based on the specific S3 bucket where a file was received. The goal is to do this purely at the configuration level, without using an intermediary Lambda function.

I attempted to set up specific invocations of Lambda functions based on the S3 bucket within the AWS Transfer Family, using IAM policies or workflow configurations. I was expecting to find a straightforward way to direct the AWS Transfer Family to invoke a specific Lambda function (e.g., 'b1' or 'b2') based on the particular S3 bucket where the file was received. My aim was to achieve this purely at the configuration level, without the need for additional coding or intermediary Lambda functions.

1 Answers1

0

In AWS Transfer Family, there isn't a direct way to invoke different Lambda functions purely based on the S3 bucket at the configuration level. However, there's a simple way to achieve this using S3 Event Notifications.

Here's how you can set this up:

1. Set up AWS Transfer Family:

  1. Create an AWS Transfer Family server.
  2. Setup users and home directories (S3 buckets).

2. Configure S3 Event Notifications:

For each S3 bucket associated with a user in the Transfer Family:

  1. Go to the S3 Console.
  2. Choose the desired bucket.
  3. Under the "Properties" tab, find the "Event notifications" section.
  4. Click on "Create event notification".
  5. Give the event a name.
  6. For the "Events" type, choose "All object create events" (or specify as per your needs).
  7. In the "Destination" section, choose Lambda function.
  8. Select the specific Lambda function you want to invoke for this bucket.
  9. Click "Save changes".

Repeat the above steps for each S3 bucket and associate each bucket with its respective Lambda function.

3. IAM Permissions:

Make sure that the S3 buckets have permissions to invoke the Lambda functions. Also, ensure the Lambda functions have the necessary permissions to access and perform actions on the S3 buckets.

This setup ensures that when a file is uploaded to a specific S3 bucket via AWS Transfer Family, the S3 bucket will automatically invoke the associated Lambda function based on the event notification.

[1] https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html

Piyush Patil
  • 14,512
  • 6
  • 35
  • 54