ner
ner

Reputation: 711

can we use cloudwatch events on s3 object with serverless

I want to know if we can create a cloudwatch event that triggered on S3 bucket every time that a change occurs on S3. For example, if a file is uploaded on s3 we recieve an email. I am using serverless framework, i found on the serverless documentation only stuff related to ec2, but not much things on s3. So please if anyone knows how to use cloudwatch with s3 i am all ears

Upvotes: 0

Views: 331

Answers (1)

Trent Bartlem
Trent Bartlem

Reputation: 2253

https://serverless.com/framework/docs/providers/aws/events/s3/

e.g.

functions:
  emailOnUpload:
    handler: email.handler
    events:
      - s3:
          bucket: photos
          event: s3: ObjectCreated:*

Upvotes: 1

Related Questions