Рет қаралды 47
📚Book link: pratimuniyal.g...
Today, I want to share some of the features of Amazon Web Service Lambda I have learned over the years. While many of you might already be familiar with these features, I hope you discover at least one new thing from this video. If you do, I'll consider it a success. Additionally, please share your experiences and any features you love that should be added to this list.
Let's start with the first feature of Lambda, which is its support for multiple languages. This means you can use Lambda with a variety of programming languages, including Python, Node J S, Java, Dot Net, Go, and Ruby. This versatility is a game-changer, as it allows you to work with the language you're most comfortable with.
The second feature is that it supports versioning. With lambda functions, it's possible to define the specific version of lambda functions(think of it like versioning in GitHub). Once you publish the version, it's immutable and can't be changed. The version will get its own Amazon Resource Name. There is also a concept of dollar Latest, which points to the latest version.
The third feature is the creation of Aliases. You can create aliases that point to a different version(prod, dev, stage). This is not immutable and can be changed. Alias is just a pointer to the function version. Using aliases, you can create blue/green deployment, which means a certain percentage(90 percent) of the workload can go to alias1 and the other half (10 percent)goes to alias2. Services can be configured to point to aliases rather than the version for, e.g., API gateway.
The fourth feature is the use of environment variables. In Lambda, an environment variable is a combination of key-value pairs. Every Lambda function can have 0 or more environment variables. These variables can be accessed within the execution environment. Environment variables can be encrypted using K M S.
The fifth feature is the Lambda layer. It lets you share your code; you can upload the layer once and then reference it for any function. Any layers we create will be extracted inside the slash opt inside the execution environment and used the same way the libraries are included in the function zip. One of the most important features of the layer is that it allows us to use custom runtime and then languages, such as Rust and C plus plus, which Lambda does not currently support.
The sixth feature is that Lambda now supports container images. You can now deploy a container to your lambda function.
The seventh feature is Lambda and Application Load Balancer integration. The Lambda function can process requests from the Application Load Balancer. Using rules, you can route the HTTP request to the Lambda function, and based on the path and header rule, it processes and returns the response to the Lambda function.
The eighth and most popular use case is Lambda with API gateway. It creates a web API with an HTTP endpoint for your Lambda function using an API gateway.
The ninth feature is the use of the Lambda function to access resources in V P C. You can configure the Lambda function to connect to private subnets in a V P C. The use case for this is if you create any resources in your V P C and want your Lambda function to access them, e.g., E C two instance, R D S Database.
the tenth feature is support for various runtime enviroment. Your code is loaded and executed within a runtime environment. This runtime environment is specifically created to run a certain language. You also specify the amount of resources that the runtime environment will use. You specify the amount of memory and depending upon the amount of memory, a certain amount of virtual CPU is allocated. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1-MB increments. At 1,769 MB, a function has the equivalent of one vCPU (one vCPU-second of credits per second). Also, 512MB of disk space is allocated under /tmp but can be scaled up to 10240MB. The Lambda function can run up to 15min(900second).