Serverless Best Practices with AWS Lambda PowerTools

For one-off tasks, AWS Lambda really can be incredibly easy. You write a few lines of code, deploy it, and you have a function running in the cloud ready to respond to events, scale automatically, and that only costs you pennies.But as your application grows, so does some necessary complexity. When a few one-off functions become a full serverless backend architecture made up of interconnected services, you’ll need to pay careful attention to best practices to ensure that your application is easy to debug, maintain, and scale.That’s where AWS Powertools for Lambda fits in. It’s a suite of reusable utilities designed to simplify bringing best practices around things like logging, tracing, metrics, idempotency and more to your Lambda functions with minimal effort.This demo session will dive into some of the functionality provided by the AWS Powertools (TypeScript) core libraries, such as:Encapsulating best practices into reusable libraries for structured logging, metrics collection, idempotency, and more.Leveraging Middy middleware to integrate common cross-cutting concerns, such as injecting Lambda context or automatically flushing metric.Enabling local testing with LocalStack, allowing you to deploy and debug Lambda functions with structured logs, trace data, and embedded metrics.Providing modular examples that can be deployed to AWS or LocalStack with ease, enabling developers to explore libraries.

Related Talks

Artifact Integrity & Open Source Governance, the shift left way

In this talk, Teja explore the intricacies of the software supply chain and discuss strategies for protecting your software against supply chain attacks. He look sinto the risks associated with these threats, offer mitigation measures, and covers recommended practices for managing open-source software and Software Bills of Materials (SBOMs). This session aims to equip the audience with the knowledge and tools needed to enhance the security of their software supply chain.

Watch recording
Watch recording
Replicating cloud resources locally with LocalStack's AWS Replicator extension

LocalStack's core cloud emulator lets you emulate various cloud services on your own computer. This means you can develop and test your cloud-based solutions without connecting to a remote cloud.However, there are times when you need to seamlessly switch between your local setup and actual cloud resources, especially in hybrid situations. For instance, you might want to share a database with your local Lambda function or access S3 files stored remotely while running a Glue ETL job locally.With LocalStack's AWS Replicator extension, your local environment can replicate AWS cloud resources at the API level, allowing direct interaction with cloud services. The Replicator extension enables you to forward specific requests from LocalStack to AWS without complex proxy setups, and create test scenarios that involve a mix of local and cloud resources.Check out our tutorial — https://docs.localstack.cloud/tutorials/replicate-aws-resources-localstack-extension/

Watch recording
Watch recording
Mounting local directories for ECS tasks with LocalStack

LocalStack's cloud emulator lets you run Amazon Elastic Container Service (ECS) clusters and tasks on your local computer. It's sometimes useful to mount code from the host filesystem directly into the ECS container. This helps quickly test changes without needing to rebuild and redeploy the ECS Task's Docker image each time.This video explains how to use code mounting with the ECS bind mounts feature. Here are the links to the resources mentioned in the video:• Sample repository: https://github.com/localstack-samples/ecs-code-mounting-python-cdk• LocalStack Docs: https://docs.localstack.cloud/user-guide/aws/ecs/#mounting-local-directories-for-ecs-tasks• AWS Docs: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html

Watch recording
Watch recording

Launch yourself in the world of local cloud development

Try for free
Try for free
Talk to Sales
Talk to Sales