- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
It is easy to implement if you are storing the files as objects in S3. S3 has a feature called Event Notifications - https://docs.aws.amazon.com/AmazonS3/latest/userguide/NotificationHowTo.html
You can create a lambda function that will get invoked whenever an S3 Event Notification is received. This lambda function can go and create/update an entry in DynamoDB - https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
Note that S3 does not have the notion of folders. S3 has the notion of prefixes that comprise the key to the objects and give the impression that they are like folders in a file system.
Hi.
@Indranil shows how to detect file creation on S3. I will answer how to detect local files.
In this case, you do not need to use any special AWS services additionally.
We'll look at how local file detection works, and then he'll simply use the AWS SDK to create records in DynamoDB.
However, since it operates as a local monitoring process, it is better to run it as a server-side daemon program separate from the Web Application.
For example, when implementing using .NET, you can detect the creation and modification of files and folders by using the FileSystemWatcher class. Hook that event and access Dynamo DB with the AWS SDK .NET.
https://stackoverflow.com/questions/67214771/how-to-use-filesystemwatcher-on-linux-with-net-5-0
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CodeSamples.DotNet.html
However, if the storage created can be offloaded to S3, an easier way is to use S3 Notifications to run the Lambda as @Indranil mentions.
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr