Giter Site home page Giter Site logo

aws_s3_trigger_tracking's Introduction

CloudFormation Template: S3 Bucket and Lambda Function

This CloudFormation template creates an S3 bucket and a Lambda function that is triggered by S3 events (ObjectCreated, ObjectRemoved, ObjectRestore, ObjectUpdate). The Lambda function puts a new item in a DynamoDB table based on the type of S3 event. The template also creates an IAM role for the Lambda function with the necessary permissions, a CloudWatch Logs group, and an alarm that is triggered when the Lambda function logs an error.

Resources

  • MyS3Bucket: An S3 bucket that triggers the Lambda function on events.
  • MyLambdaFunction: A Lambda function that is triggered by S3 events and writes to a DynamoDB table.
  • MyLambdaExecutionRole: An IAM role for the Lambda function.
  • MyLambdaLogGroup: A CloudWatch Logs group for the Lambda function logs.
  • MyLambdaMetricFilter: A CloudWatch Logs metric filter that counts the number of Lambda errors.
  • MySnsTopic: An SNS topic that is notified when the Lambda function logs an error.
  • MyLambdaErrorAlarm: A CloudWatch alarm that is triggered when the Lambda function logs an error.

Usage

  1. Deploy the CloudFormation stack using the AWS CLI or AWS CloudFormation console.
  2. Upload files to the S3 bucket to trigger the Lambda function and log events.
  3. View the DynamoDB table and CloudWatch Logs to see the events and logs.
  4. Monitor the CloudWatch alarm for Lambda errors.

Parameters

None

Outputs

  • MyS3BucketName: The name of the S3 bucket created by the CloudFormation stack.
  • MyLambdaFunctionName: The name of the Lambda function created by the CloudFormation stack.
  • MyLambdaExecutionRoleArn: The ARN of the IAM role created by the CloudFormation stack for the Lambda function.
  • MyLambdaLogGroupName: The name of the CloudWatch Logs group created by the CloudFormation stack for the Lambda function.
  • MySnsTopicArn: The ARN of the SNS topic created by the CloudFormation stack.
  • MyLambdaErrorAlarmArn: The ARN of the CloudWatch alarm created by the CloudFormation stack.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a new branch
  3. Make your changes and commit them
  4. Push your changes to your forked repository
  5. Submit a pull request

aws_s3_trigger_tracking's People

Contributors

adarrshpaul avatar

Watchers

 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.