Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Building and Triggering an AWS Lambda Function for Beginners!

What is AWS Lambda? Lambda allows us to run our code on a high-availability compute infrastructure without provisioning or managing servers. It is a serverless compute service that is highly scalable, cost-efficient and ideal for…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Image description




What is AWS Lambda?




Lambda allows us to run our code on a high-availability compute infrastructure without provisioning or managing servers. It is a serverless compute service that is highly scalable, cost-efficient and ideal for event-driven architecture



Asynchronous Function



Lambda can be used in many things




  1. Data Processing




  • Process real-time streaming data from services like Amazon Kinesis or Amazon SQS.

  • Transform and store data in databases or data lakes.



2 Web Applications




  • Build and deploy RESTful APIs with AWS API Gateway.

  • Serve as backend logic for lightweight web apps.



3 Event-Driven Tasks




  • Trigger tasks such as image resizing, sending notifications, or cleaning logs when files are uploaded to S3






In this guide, we'll explore AWS Lambda, create a basic function, test it, and finally implement a useful notification simulation.



Now we're going to test the AWS Lambda and to do this we need to set up a few things. Follow these steps:






Step 1: Create a Lambda Function




  1. Log in to the AWS Management Console

    Go to aws.amazon.com to sign up if you don't have an account


  2. Navigate to the AWS Lambda service.




Note: You can easily navigate it by searching it on the search bar [Alt + S]

3 Click 'Create a Function'



Use cases



4 In the Basic Information pane let's name it 'myLambdaFunction'

Note: You can name it the way you want



5 For Runtime, choose either Node.js 22.x or Python 3.13.

In this case I'll be using Node.js



After setting up that should look like this

Image description



6 Click 'Create Function'

After doing so it should look like this



Image description





Step 2: Create a simple testing code



This snippet came from the documentation as a way to test waters but later, I will show some application




export const handler = async (event, context) => {

const length = event.length;

const width = event.width;
let area = calculateArea(length, width);
console.log(`The area is ${area}`);

console.log('CloudWatch log group: ', context.logGroupName);

let data = {
"area": area,
};
return JSON.stringify(data);

function calculateArea(length, width) {
return length * width;
}
};







  • Deploy the code by clicking Deploy



Image description




  • The function is named handler with two arguments event and context

  • An event in Lambda is JSON (JavaScript Object Notation) that bears our data

  • In this case we'll create an event in the console by entering a JSON formatted document with two key-value pairs. 'length' and 'width'

  • The second argument we take is context which contains information about the function invocation and execution environment. In this sample it uses the '.logGroupName' to output the name of its CloudWatch






Step 3: Create a Test Event




  1. In the Test Event section you can choose Create test event



Image description




  1. After clicking that you should see this.



Image description




  1. Lets name it 'myTestEvent'

  2. In the event JSON section, replace the default JSON with the following:




{
"length": 6,
"width": 7
}







So as you can see it's all coming together right since this is what we're chaining in the event argument





  1. Choose Save



To test this code just click the run icon



Image description



and voila you have tested your first lambda function!






Now for the last part we're going to create something useful but still faithful to this structure



Now let's change the code with this:




export const handler = async (event, context) => {

const { email, password } = event;

if (!email || !password) {
return {
statusCode: 400,
body: JSON.stringify({ message: "Email and password are required." }),
};
}

const notiMessage = `Notification sent to: ${email}`;
console.log(notiMessage);
console.log('CloudWatch log group: ', context.logGroupName);
return {
statusCode: 200,
body: JSON.stringify({
message: "Notification triggered successfully.",
details: notiMessage,
}),
};
}







Here's what this function does.




  • So first instead of repeatedly typing the event we declared right away all the things we're expecting to come 'email' & 'password'

  • Then create a simple if validation to check if the 'email' & 'password' has a value

  • We still use the CloudWatch to monitor the logs

  • And if all goes as planned the body would return a success message that has a binded value of static string and the the details with the binded value of the const notiMessage



Now for the test event lets just change the keys and values




{
"email": "[email protected]",
"password": "7hi$isAT3stSimUl5t0n"
}






Then we run it and it should ouput something like this:



Image description



If you want to advance you can use Nodemailer and to actually send an actual email message as well as implementation of asynchronous programming. For documentations just follow the links here:



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building and Triggering an AWS Lambda Function for Beginners!

Thematisch verwandte Begriffe: Building, Triggering, Lambda, Function · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94097 | A vulnerability was determined in Netcore NBR200V2 1.3.241127.071246. Th…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick