Reputation: 175
I have a website developed using HTML, CSS. This website is NOT hosted on Amazon AWS.
I have a separate Amazon AWS S3 bucket created. I want to have a functionality in my website that it can talk with this Amazon AWS S3 bucket. For example, whenever any image is uploaded on S3 bucket by some random user, my web site gets to know about it. My website may get a notification.
How can I achieve this?
Should I switch to some technology other than HTML for better integration of my web site with Amazon AWS S3? What is the current (best) industry technology in use for this?
Upvotes: 2
Views: 91
Reputation: 5797
A popular solution to get notified about changes in an S3 bucket is to use S3 event notifications: https://docs.aws.amazon.com/AmazonS3/latest/userguide/NotificationHowTo.html . This gives you a trigger to do something when someone e.g. uploads a new object in your S3 bucket.
In order to do something with this event, S3 notifications support SNS, SQS and Lambda. You could let S3 trigger a lambda function of yours which notifies your web server about this event. Here you can do whatever you want, such as a simple HTTP call against your server. Your server must be reachable from the internet or from within your AWS VPC (via DirectConnect or VPN) for this to work.
Another solution is to simply poll the bucket every once in a while to list all objects in the bucket uploaded after the last time you checked.
Upvotes: 1