Bette  Shanahan

Bette Shanahan

1598238420

Introduction To AWS Lambda For Dummies

There’s something really human about software. It grows not in the direction that is most efficient, in terms of resource utilization, but it seeks simplicity. AWS Lambda offers a completely different paradigm for you to design/run your apps. Before we delve deeper into the core of AWS Lambda let’s put, in simpler terms, what it will help us achieve.

Your application, or at least a certain part of it, involves doing a set of simple operations preceded by a real-world event. For example, there’s a request to view an html page and there’s a bit of Node.js code that executes in response to it. If that’s the case, then it is wasteful to have a web server like apache or nginx running 24/7 waiting for that event to occur and then perform an action in response to it.

This is illustrated rather well in this smbc comic.

Developer rendering himself comic strip

AWS Lambda is a solution to reduce this wastage of resources. It essentially spins up the service in response to an event. That is to say, your code sits out there as just a file and AWS keeps a lookout for a trigger event, which you are interested in. When that event occurs, then the code is executed and the required operations are carried out by your code. You are billed only for the amount of resources your program consumes, and for the time for which it runs.

The server doesn’t exist until the user goes out there to look for it! Which is termed as ‘serverless’ compute. A more proper term would be Function-as-a-Service (FaaS).

#aws #dummies

What is GEEK

Buddha Community

Introduction To AWS Lambda For Dummies

Cross-account access to invoke AWS lambda using AWS CDK

If you are here, you may have a pretty good knowledge of how to use AWS CDK for defining cloud infrastructure in code and provisioning it through AWS. So let’s get started on how to grant permission to your lambda function to access the resources in another AWS account.

Let’s say you have two accounts called Account A and Account B, and you need to give permission to lambda function in Account A (ex: 11111111)to access the resources in Account B(22222222). You can easily do this by assuming an IAM Role in Account B and then uses the returned credentials to invoke AWS resources in Account B.

#acces #account #aws #lambda #aws lambda #aws cdk

Cache secrets using AWS Lambda extensions

What is the AWS Lambda extension?

A month back AWS announced a preview of Lambda Extensions, a new way to easily integrate Lambda with your favorite monitoring, observability, security, and governance tools. Extensions can be published as Lambda layers, there are two types are extension:

  • Internal extensions → Run as part of the runtime process, in-process with your code. Internal extensions enable use cases such as automatically instrumenting code.
  • External extensions → Allow you to run separate processes from the runtime but still within the same execution environment as the Lambda function. External extensions can start before the runtime process and can continue after the runtime shuts down. These extensions run as companion processes to Lambda functions.

#aws #aws-secrets-manager #lambda #aws lambda

An Introduction to the AWS Scheduled Lambda Function

The topic of the scheduled launch of lambda functions is quite relevant for AWS serverless solutions. Nowadays, almost all projects use the same approach, and even though it works it is far from the optimal approach. In this article, we will consider alternatives and define which option will work best in practice.

For the purposes of illustration, let’s take a look at architectures of the following type:

  1. User
  2. API GW
  3. Lambda functions

There is a mobile application designed to book rooms in hotels. Also, the application functionality allows for keyless access to the room.

A back-end developer is expected to prepare the following:

  1. An API for creating and managing reservations.
  2. Checking the arrival of the client within 2 hours from the start of the reservation.
  3. Activation of the client’s key right at the start of the reservation.

The serverless solution means that the system has no initiator, and we need to somehow run the function to activate the key or cancel the reservation. Most often, CloudWatch rules are used for such tasks.

#aws #aws-lambda #amazon-web-services #lambda #cloudwatch

Gordon  Matlala

Gordon Matlala

1617875400

Adding Code to AWS Lambda, Lambda Layers, and Lambda Extensions Using Docker

2020 was a difficult year for all of us, and it was no different for engineering teams. Many software releases were postponed, and the industry slowed its development speed quite a bit.

But at least at AWS, some teams released updates out of the door at the end of the year. AWS Lambda received two significant improvements:

  • AWS Lambda Extensions; and
  • Support of Docker images for your functions.

With these two new features and Lambda Layers, we now have three ways to add code to Lambda that isn’t directly part of our Lambda function.

The question is now: when should we use what?

In this article, I try to shine some light on the Lambda Layers, Lambda Extensions, and Docker image for Lambda.

First things first. All these Lambda features can be used together. So if you think about where to put your code, at least your decisions aren’t mutually exclusive. You can upload a Docker image and attach a regular Lambda Layer and a Lambda Extension. The same is possible if your Lambda function is based on a ZIP archive.

What does this all mean? Keep reading and find out.

#aws #aws-lambda #serverless #devops #docker #lambda

Seamus  Quitzon

Seamus Quitzon

1601341562

AWS Cost Allocation Tags and Cost Reduction

Bob had just arrived in the office for his first day of work as the newly hired chief technical officer when he was called into a conference room by the president, Martha, who immediately introduced him to the head of accounting, Amanda. They exchanged pleasantries, and then Martha got right down to business:

“Bob, we have several teams here developing software applications on Amazon and our bill is very high. We think it’s unnecessarily high, and we’d like you to look into it and bring it under control.”

Martha placed a screenshot of the Amazon Web Services (AWS) billing report on the table and pointed to it.

“This is a problem for us: We don’t know what we’re spending this money on, and we need to see more detail.”

Amanda chimed in, “Bob, look, we have financial dimensions that we use for reporting purposes, and I can provide you with some guidance regarding some information we’d really like to see such that the reports that are ultimately produced mirror these dimensions — if you can do this, it would really help us internally.”

“Bob, we can’t stress how important this is right now. These projects are becoming very expensive for our business,” Martha reiterated.

“How many projects do we have?” Bob inquired.

“We have four projects in total: two in the aviation division and two in the energy division. If it matters, the aviation division has 75 developers and the energy division has 25 developers,” the CEO responded.

Bob understood the problem and responded, “I’ll see what I can do and have some ideas. I might not be able to give you retrospective insight, but going forward, we should be able to get a better idea of what’s going on and start to bring the cost down.”

The meeting ended with Bob heading to find his desk. Cost allocation tags should help us, he thought to himself as he looked for someone who might know where his office is.

#aws #aws cloud #node js #cost optimization #aws cli #well architected framework #aws cost report #cost control #aws cost #aws tags