profile

AWS for the Real World

A Frictionless Way of Building Serverless Applications on AWS ⚑️

Published 7 months agoΒ β€’Β 4 min read

πŸ‘€ This is not properly displayed? Read all of our issues online! πŸ’‘

Hi Reader πŸ‘‹πŸ½

Let's start with the obvious: We love AWS Lambda! πŸ’›β€‹
​
And we're pretty sure you too, regardless of whether you're a long-term AWS Fundamentals subscriber or just recently joined. πŸ™

That's why we want to dedicate this newsletter to the fastest IaC to launch Serverless applications on AWS: The Serverless Framework

Citing DataDog's The State of Serverless:

[...] Serverless Framework is the most popular IaC tool for managing AWS Lambda functions among Datadog customers.

Even more:

It provides streamlined opinionated workflows that make it straightforward to deploy applications and serverless infrastructure together. This, along with the strong community support it has among developers, has made it a popular and inviting entry point for newcomers and serverless-focused teams.

Let's get going! πŸ‘Ύ

Why Bother with Serverless Framework?

Creating the necessary infrastructure for a simple service powered by Lambda and exposed to the internet via API Gateway can be a complex task.

While it is possible to manually configure everything in the AWS console, this approach is not recommended for serious projects due to its lack of reproducibility and potential for errors.

Serverless Framework simplifies this tremendously. It abstracts away much of the boilerplate configuration needed for Lambda, API Gateway, and other native integrations with AWS services like SQS or EventBridge.

In addition, Serverless Framework handles the packaging of your code and offers a powerful CLI that allows you to easily deploy Lambda functions.

​

Serverless Templates

When running sls , you will be prompted to choose a starter template, so you can get things going very quickly.

But that's not all offered by Serverless Framework.

There's also a searchable set of Real-world (😏) serverless architecture examples. πŸ—οΈ

​

Abstraction in Perfection

Serverless Framework provides a wide range of tools and features that not only simplify the process of setting up intricate infrastructure configurations but also incorporate industry best practices seamlessly.

Let's explore its concepts. πŸ“š

​

Services

In the Serverless Framework, a service is a fundamental unit of organization that is defined by the serverless.yml configuration file (or serverless.ts if you want to use TypeScript!).

This configuration file is then transformed into a CloudFormation template, which is used to create the necessary resources.

To create a new service configuration, you can simply run the sls command without any parameters. πŸ—οΈ

​

Functions

Functions serve as the compute layer in your serverless architecture, running on AWS Lambda.

They operate independently in terms of execution and deployment. While they typically serve a single purpose (small, dedicated functions), they are not limited to it and can perform multiple tasks if needed (fat functions).

Serverless Framework also offers easy configuration for:

  • VPCs for private networks
  • Lambda Layers for externalizing dependencies
  • Destinations
  • Dead Letter Queues for failed invocations
  • Versioning of functions
  • X-Ray & tracing

… and much more.

​

Packaging

In the previous instance, we discussed an externally packaged deployment unit as an example.

However, Serverless also offers the capability to package your function's code internally.

Rather than relying on an artifact, you can utilize patterns to specify the files that should be included in your deployment unit ZIP file.

​

Triggers

Serverless simplifies the process of creating triggers for your functions through events such as HTTP calls or messages.

It automatically creates the required infrastructure to seamlessly connect these events to your functions. 🀝

πŸ’‘ Example: An HTTP event is received through the Gateway, specifically for the /api/* path.

​

Community Plugins

Serverless is an incredibly robust tool that comes equipped with a wide range of built-in features.

However, there's even more potential via the community plugins available! πŸ‘₯

Naming just a few prominent ones:

The plugin ecosystem is vast, offering a wide range of plugins to cater to almost any use case.

Much More to Explore

In this brief overview, we have only scratched the surface of the Serverless Framework and its capabilities. There is so much more to explore and learn about this powerful tool.

For a more comprehensive understanding, we recommend diving into our dedicated section on the Serverless Framework in our AWS Fundamentals book. πŸ“™

So, if you're hungry for more information and eager to expand your understanding, be sure to check it out! As a newsletter subscriber, you're always in for a 15% discount on all of our products 😊

​

Beyond AWS Fundamentals

We wanted to give a shoutout to Alex DeBrie, an AWS Hero with a knack for DynamoDB, serverless applications, and cloud-native technologies. Whether you're a newbie or a seasoned AWS user, Alex's expertise can help you and your team make the most of AWS.

One thing that sets Alex apart is his ability to explain complex concepts in a simple and approachable way. He's also a fantastic writer, with articles like How you should think about DynamoDB costs and Event-Driven Architectures vs. Event-Based Compute in Serverless Applications showcasing his deep understanding of AWS services and his practical solutions to common challenges.

If you are looking to work with DynamoDB in the future, we highly recommend buying and reading β€œThe DynamoDB Book”. This comprehensive resource provides valuable insights and guidance on effectively utilizing DynamoDB. It covers various topics, including best practices, advanced techniques, and practical examples, making it the perfect reference.

Whether you are a beginner or an experienced developer, it will greatly enhance your understanding and proficiency in working with DynamoDB.

​

We'll also finish this issue with Alex by passing you one of his articles about Serverless Framework vs. AWS CDK.

​

Wishing you a great week & happy learning! πŸ“š

Sandro & Tobi πŸ‘‹


Still hungry for AWS content? Have a look at our blog! πŸ“š ↓

AWS for the Real World

by Tobi & Sandro

Join our community of over 8,800 readers delving into AWS. We highlight real-world best practices through easy-to-understand visualizations and one-pagers. Expect a fresh newsletter edition every two weeks.

Read more from AWS for the Real World

βŒ› Reading time: 11.5 minutes πŸŽ“ Main Learning: Host Web Applications on AWS with the CloudFront Hosting Toolkit πŸ‘¨πŸ½πŸ’» GitHub Code πŸ“ Blog Post Hey Reader πŸ‘‹πŸ½ Happy New Week! I (Sandro) will attend the Serverless Days in Milano next week where Jeremy Daley will hold the keynote. I look forward to meeting many of you and the overall AWS community. This week's newsletter is all about hosting your frontend on AWS. AWS launched a new way of deploying your frontend to it: The CloudFront Hosting Toolkit....

10 days agoΒ β€’Β 6 min read

βŒ› Reading time: 7 minutes πŸŽ“ Main Learning: Visual Regression Testing with AWS CloudWatch Synthetics πŸ‘¨πŸ½πŸ’» GitHub Code πŸ“ Blog Post Hey Reader Keeping your website running smoothly is important.It's also important to keep an eye on its visual appearance and that it doesn't change due to an unwanted change. AWS CloudWatch Synthetic Canaries is a tool that helps you check on your websites (and APIs!) to make sure it’s working well and look as expected. In this newsletter, we’re going to show you...

about 1 month agoΒ β€’Β 4 min read

Hi Reader and happy May the 4th ⭐. We want to start the spring by giving you an amazing discount on our book and other resources. For that, we have partnered with four different AWS Creators around the globe. You can use the code AWSFUND30 to get 30% off. The resources are: πŸ“™ AWS Fundamentals - Like this newsletter, it covers the basics of essential AWS Services for real-world applications. πŸ“˜ The DynamoDB Book - Level up your DynamoDB modeling and finally understand Single-Table Design. πŸ—οΈ...

about 2 months agoΒ β€’Β 1 min read
Share this post