Git Product home page Git Product logo

cf_lambda_s3_to_pg's Introduction

README from the dude's code I am extending

AWS S3 Real Time Event Processor

Lets say, we have to do some action for every object uploaded / added to S3 Bucket. We can use DynamoDB Streams along with Lambda to achieve the same.

AWS Serverless S3 Real Time Event Processor

Follow this article in Youtube

  1. Prerequisites

  • AWS CLI pre-configured
  1. Clone the repository

    git clone https://github.com/miztiik/serverless-s3-event-processor.git
  2. Customize the deployment

    Edit the ./helper_scripts/deploy.sh to update your environment variables. The expected output in cloudwatch logs should look like this,

    AWS_PROFILE="default"
    BUCKET_NAME="sam-templates-011" # bucket must exist in the SAME region the deployment is taking place
    SERVICE_NAME="serverless-s3-event-processor"
    TEMPLATE_NAME="${SERVICE_NAME}.yaml"
    STACK_NAME="${SERVICE_NAME}"
    OUTPUT_DIR="./outputs/"
    PACKAGED_OUTPUT_TEMPLATE="${OUTPUT_DIR}${STACK_NAME}-packaged-template.yaml"
  3. Deployment

    We will use the deploy.sh in the helper_scripts directory to deploy our AWS SAM template

    chmod +x ./helper_scripts/deploy.sh
    ./helper_scripts/deploy.sh
  4. Test Event Processor

    Upload an object to the S3 Bucket or use the event.json in the src directory to test the lambda function. In the lambda logs you will see the following output,

    {
      "status": "True",
      "TotalItems": {
        "Received": 1,
        "Processed": 1
      },
      "Items": [
        {
          "time": "2019-05-08T18:51:00.097Z",
          "object_owner": "AWS:AIDdR7KsQLWs56LRA",
          "bucket_name": "serverless-s3-event-processor-eventbucket-novet8m933s4",
          "key": "c19cf74b-ca14-4458-b2f1-c97b51789f67.xls"
        }
      ]
    }

Contact Us

You can reach out to us to get more details through here.

cf_lambda_s3_to_pg's People

Contributors

bgoldfe2 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.