'Add multiple suffix in s3 event notification from console
I need event notification when files with multiple extensions like .log, .txt, etc has been added to AWS s3 bucket. Can we add multiple suffix in s3 event notification from console ?
Solution 1:[1]
You should use Lambda with an S3 trigger to your bucket and edit the function code to check for the file type.
Eg. for Node JS use something like this:
// Check that the file type is supported
const fileType = typeMatch[1].toLowerCase();
if (fileType != "txt" && fileType != "pdf") {
console.log(`Unsupported file type: ${fileType}`);
return;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NineCattoRules |
