GithubHelp home page GithubHelp logo

raghavjindal13 / aws-lambda-triggers Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 40 KB

A collection of AWS lambda functions that can be used in different scenarios for automation purposes.

aws aws-lambda lambda-functions python lambda-architecture vpc cloudwatch-logs lambda-layer

aws-lambda-triggers's Introduction

AWS Lambda

AWS Lambda provides you a serverless architecture and allows you to run a piece of code in the cloud after an event trigger is activated.
AWS Lambda is a zero-administration compute platform for the back-end web developers that runs your code for you on the AWS Cloud and provides you with a fine-grained pricing structure.
AWS Lambda runs your backend code on its own AWS compute fleet of Amazon EC2 instances across multiple Availbility zones in a region which provides the high avilability,security,performance,and scalability of AWS infrastructure.



Execution Role (Common Execution Role Available).
AWSLambdaBasicExecutionRole Grants permissions only for the Amazon CloudWatch Logs actions to write logs.
AWSLambdaKinesisExecutionRole Grants permissions for Amazon Kinesis Streams actions, and CloudWatch Logs actions.
AWSLambdaDynamoDBExecutionRole Grants permissions for DynamoDB streams actions and CloudWatch Logs actions.
AWSLambdaVPCAccessExecutionRole Grants permissions for Amazon Elastic Compute Cloud (Amazon EC2) actions to manage elastic network interfaces (ENIs).
AWSXrayWriteOnlyAccess Grants permission for X-ray to to upload trace data to debug and analyze.

VPC

1. When you enable VPC, your Lambda function will lose default internet access.
2. If you require external internet access for your function, ensure that your security group allows outbound connections.
   and that your VPC has a NAT gateway.

Concurrency

1. Concurrent Execution refers to the execution of number of function at a given time. By default the limit\ is 1000 across all function within a given region.
2. AWS Lambda keeps 100 for the unreserved function.
3. So, if there are 1000 then you can select from 900 and reserve concurrency for selected function and rest 100 is used for the unreserved function.

DLQ (Dead Letter Queue)

1. Failed Lambda is invoked twice by default and the event is discarded.
2. DLQ instruct lamnda to send unprocessed events to AWS SQS or AWS SNS.
3. DLQ helps you troubleshoot and examine the unprocessed request.

Cron Job

1. Cron Jobs allow you to automate certain commands or scripts on your server to complete repetitive tasks automatically.
2. Cron Job can be set to run by 15 minute or hourly increments, a day of the week or month, or any combination of these.
3. This means that you can trigger the Lambda function automatically fter every time interval which is specified.
4. rate(1 day) OR cron(0 17 ? * MON-FRI *)  --0 mins 17hrs every month mon to fri every year.

Throttle

1. Throttle will set reserved concurrency of the function to zero and it will throttle all future invocation.
2. If the function is throttled then it will fail to run.
3. If the fucntion is ran from Lambda console then it will throw "Calling the Invoke API failed with message: Rate Exceeded."

Invoke Lambda function from another Lambda Function

1. create two lambda functions and add awsLambdaRole in the existing basic rule.
2. A Lambda can invoke another Lambda.
3. A Lambda in one region can invoke another lambda in other region.
4. A Lambda can invoke same Lambda.
5. Invoke same Lamba with different version.

EC2 instance state and status check via Lambda function

1. Check state and ststus of all ec2 instances.
2. Get the state change notification in s3 bucket.
3. Trigger email notification of ec2 instance state change.
4. SSH into ec2 instance via lambda function.
5. Fetch date and time of stopped ec2 instance.

Trigger email notification

1. Flow will be like whenever we make a cnagse in s3 bucker lambda will trigger SES.
2. Under the S3 bucket properties enable events.
3. You can also send the file which have been modified or added in the mail.

aws-lambda-triggers's People

Contributors

raghavjindal13 avatar

Watchers

 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.