دالة Lambda الأولى
اكتب دالة Lambda بسيطة من نوع 'Hello World' وهيّئها وانشرها باستخدام وحدة تحكم AWS، واكتسب خبرة عملية بالمنصة
دالة Lambda الأولى درس مجاني في Serverless AWS Lambda Development على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Serverless AWS Lambda Development، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Serverless AWS Lambda Development 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Your First Lambda Function
Time to build! You will create and deploy your first Hello World Lambda right in the AWS console — your practical step into serverless.
Find Lambda in AWS Console
Log into the AWS console, search "Lambda" in the top bar, and select it to open the Lambda dashboard where all your functions live.
Start a New Lambda Function
On the dashboard, click Create function and choose "Author from scratch" to define a brand-new serverless function.
Name Your Function & Runtime
Set the basics: a unique Function name and a Runtime — the language your code runs in. We will use Python 3.9 here.
Lambda's Permissions: Execution Role
Your function needs an execution role (an IAM role) for permissions. Pick "Create a new role with basic Lambda permissions" to allow CloudWatch logs.
Code Your 'Hello World'
The console opens a code editor — replace the default with this simple Python Hello World handler.
import json
def lambda_handler(event, context):
# Log the event for debugging purposes
print(f"Received event: {event}")
# Return a simple greeting
return {
'statusCode': 200,
'body': json.dumps('Hello from your first Lambda!')
}Save & Deploy Your Function
After editing, click Deploy to save your changes and make the new version live. Skip this and the Lambda service keeps the old code.
Test Your Lambda Function
Open the Test tab and configure a test event — the hello-world template works — name it, then click Test to invoke your function and see results.
Check Logs for Output
After a test, results appear inline. For full output, including your print() statements, open CloudWatch Logs where Lambda sends its runtime logs.
Quick Check: Lambda Deployment
You've just deployed your first Lambda! Let's check your understanding of the essential steps.
Recap: Your First Lambda
Congrats! You created, configured, coded, deployed, and tested your first Lambda function — the foundational skill for serverless apps.
الأسئلة الشائعة
هل درس «دالة Lambda الأولى» مجاني؟
نعم — نص درس «دالة Lambda الأولى» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Serverless AWS Lambda Development، انتقل إلى CoddyKit PRO. تتضمن دورة Serverless AWS Lambda Development 4 دروس في المجموع.
ماذا ستتعلم في «دالة Lambda الأولى»؟
اكتب دالة Lambda بسيطة من نوع 'Hello World' وهيّئها وانشرها باستخدام وحدة تحكم AWS، واكتسب خبرة عملية بالمنصة تتمرن على Serverless AWS Lambda Development مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Serverless AWS Lambda Development؟
لا تُشترط خبرة سابقة. Serverless AWS Lambda Development على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «دالة Lambda الأولى»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Serverless AWS Lambda Development هذا؟
نعم. كل درس في Serverless AWS Lambda Development يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- ما هي الحوسبة عديمة الخوادم؟
- البدء باستخدام AWS Lambda
- دالة Lambda الأولى
- تسعير الخدمات عديمة الخوادم والمستوى المجاني