Can we provide a dynamic prefix of s3 event for lambda

0

I have a S3 bucket and 4 folders for the bucket where DynamoDB table's export to S3 happens for 4 different AWS DDB tables. AWS follows below s3 url structure for upload to S3:

s3://<bucketName>/<folder-name-that-we-defined/AWSDynamoDB/<alphanumeric-prefix-that-aws-creates>/exportFiles*

eg url in our case:

s3://devBucket/codes/AWSDynamoDB/12345679196049-dsc0fg/exportFiles*

We want to trigger the lambda function to invoke glue jobs when s3 upload completes inside the auto-generated alphanumeric-prefix. Since we do not have control over the alphanumeric-prefix, is there a way to provide this dynamically, when we create event notification for S3 bucket?

asked 9 months ago155 views
1 Answer
0

Hi,

I think that if you restrict the Lambda trigger to s3://<bucketName>/<folder-name-that-we-defined/*, you are good since you control tkey segment which is <folder-name-that-we-defined: nobody else than DDB will write there

See https://aws.amazon.com/blogs/compute/amazon-s3-adds-prefix-and-suffix-filters-for-lambda-function-triggering/ for all details

Best,

Didier

AWS
EXPERT
answered 9 months ago
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions