This blog is the collection of the articles I have referred to get myself hands dirty with AWS Lambda. I have meticulously referred and personally tried each of these articles, before listing them here.
I have personally focused on articles dealing Lambda functions in Python programming language, since Python is my first preference programming language.
Begin with ....
- The AWS Lambda Tutorial gives a broader introduction to Lambda, particularly the need for it, the building blocks associated with it (Lambda function, Event Source, Log streams), comparison of Lambda with EC2 and Elastic Beanstalk, benefits, limitation, pricing, use-cases and finally a simple Hands-on example. But it's better to follow the hands-on example from AWS documentation given in the next bullet point, since the instructions in this page is not up-to date.
- The Create a Lambda function with the console is a quick tutorial from AWS, to get hands dirty. It takes less than 5 mins to complete the instructions. This is very basic and you'll not have much fun at the end of it.
- The AWS Lambda with Python: A Complete Getting Started Guide is a better example to start. It demos the use of environment variables and the process to encrypt secret values using AWS KMS and then decrypting the encrypted values in lambda function. The code sample to decrypt didn't work for me, the below code worked, which is generated by AWS itself while encrypting the env variable.
import os
import boto3
from base64 import b64decode
DB_HOST = os.environ["DB_HOST"]
DB_USER = os.environ["DB_USER"]
ENCRYPTED = os.environ['DB_PASS']
DECRYPTED = boto3.client('kms').decrypt(
CiphertextBlob=b64decode(ENCRYPTED),
EncryptionContext={'LambdaFunctionName': os.environ['AWS_LAMBDA_FUNCTION_NAME']}
)['Plaintext'].decode('utf-8')
def lambda_handler(event, context):
print("Connected to %s as %s" % (DB_HOST, DB_USER))
print("and the secret is %s" % DECRYPTED)
return None
- The AWS LAMBDA TUTORIAL: A GUIDE TO CREATING YOUR FIRST FUNCTION provides another simple example, which creates Lambda function using a 'Blueprint' (sample code provided by AWS), while other previous examples used 'Author from scratch' to create Lambda function.
- The How to Create Your First Python 3.6 AWS Lambda Function from fullstackpython.com provides another simple example using environment variables in Lambda function. The example function takes a string to print and number of times it needs to be printed from environment variables and print them accordingly.
Step-up ...
The tutorials in the previous section just dealt with creating Lambda functions from AWS console UI and triggering them from the 'Test' interface from the same console UI. The next set of tutorials guides about triggering the Lambda function with an http endpoint provided by api gateway.
- The Code Evaluation With AWS Lambda and API Gateway guides us to setup an api gateway for Lambda function and to invoke Lambda function via curl or from browser.
Articles to refer further
- Serverless Slash Commands with Python
- Deploying to AWS Lambda: Python + Layers + CloudWatch
- Serverless Phone Number Validation with AWS Lambda, Python and Twilio
- Sharing Code Dependencies with AWS Lambda Layers
- How to Handle your Python packaging in Lambda with Serverless plugins
- 10 Practical Examples of AWS Lambda
- 10 AWS Lambda Use Cases to Start Your Serverless Journey
6 comments:
Nice Post!
Very good content about Aws lamba
AWS Architect Training
AWS Training
A great website with interesting and unique material what else would you need. ExcelR Data Science Course In Pune
Nice post and valuable knowledge . Check our website too which has good information.
This Open source project management script is mainly designed for the people to make the business project management and to manage the task module and the project planning efficiently, because nowadays there is a huge need in small and medium business firm industry for project management site.
I am regular reader of your blog and no doubt it all stuff is awesome. The best thing about your sharing and posting is that you always provide content that is helpful for both the newbie and experts.If you want to run your business perfectly then go for the Open Source Project Management script, it helps to manage the task module,event management, to maintain the project task of the individual person and project planning and etc...they are developed this script to solve these problems with user attraction templates, to make the business communication effectively.
Open Source Project Management script
valuable content power bi training
Nice Post!!
Please look into this-
Are you ready to unlock your potential and take your career to new heights? Look no further than the Business Analyst Course at upGrad Campus. Designed for ambitious professionals like you, this comprehensive program equips you with the skills and knowledge needed to excel in the dynamic field of business analysis.
Post a Comment