- Welcome.
We are gonna start this lesson by talking about,
one of the most important
and well integrated services in the entire AWS ecosystem,
AWS Lambda.
So, what exactly is this service?
It's deployed at a region scope.
So, it's going to fit the profile of many of the services
that operate as sort of a software as a service offering.
Well, Lambda is designed to deploy serverless functions
on behalf of the customer
and these can be deployed using different run times.
There are a list of supported run times
that are managed by AWS with specific versions
of each of those run times.
But there's also an option,
where you can deploy your own run time,
using a specific framework.
And so let's talk about these a little bit more
when we dig into the actual configuration
of a Lambda function.
Lambda functions also support what we call triggers,
which determine the conditions under which the function
is invoked.
And these triggers can range through so many different areas
of the AWS ecosystem from EventBridge rules
to S3 bucket actions, to SNS topics,
to any number of other types of triggers.
So, some of the different features of Lambda functions.
First one I've mentioned triggers the ability
to invoke a function,
based on an event, action or time schedule.
We have concurrency,
which means if you have multiple triggers,
happening at the same time,
they can invoke multiple parallel copies
of the same function,
which gives it a great ability to scale according to load.
But you also wanna make sure that you are optimizing
for cost and potentially avoiding any unexpected load
on backend resources,
so you can configure the number of functions
that can be invoked concurrently using this feature.
The next feature, scaling,
I mentioned already with the concurrency.
So, if you have multiple actions invoking the same trigger,
you can choose to have multiple copies
of your function running at the same time.
And this scaling is going to be very quick,
especially when compared to EC2 or container-based scaling.
And finally if you want to deploy your Lambda function,
so that it has a footprint in one of your VPC subnets,
it supports that.
There are some limitations with Lambda functions,
including timeouts that have a maximum of 15 minutes.
So, it means you can't just execute,
a Lambda function forever.
It does need to have a specific end point.
The different run times
that are supported are for the most part,
all the popular languages that are used today,
Node.js, Python, Ruby, Java, Go, .NET
and the ability to create a custom runtime.
So, if you wanted to execute Fortran code
in a Lambda function,
there's a way to make that happen.
Now, in terms of provisioning a Lambda function,
there are a number of parameters
that you need to take into account.
Some of these are required,
others are optional.
Triggers are not actually required.
You can invoke a Lambda function just by using the AWS CLI.
The function code required,
so the actual zip file
or pasting code into the console and so forth.
Permissions are required.
And if you don't provide them,
the Lambda function will create them,
using a default template.
This is just an IAM role that can be unique per function.
And some of the default permissions include the ability
to push metrics into CloudWatch
and logs into CloudWatch Logs.
Tags are optional.
The compute resources while there's a default,
you get to choose the amount of memory
that is allocated to the function
and that in turn determines the CPU
that it can take advantage of.
Network placement is optional.
There are a number of debugging and error handling options,
including the ability to use X-Ray tracing of your code.
And that afore mentioned concurrency option
is also something that you want to consider
that even though it's optional,
you may want to have a hard coded value for every function,
so that it can't be invoked more often than what you expect.