AWS Bites

AWS Bites
undefined
Jun 16, 2022 • 25min

41. How can Middy make writing Lambda functions easier?

Lambda functions are small units of code that achieve a specific purpose. It’s always a good idea to keep your code short, clean and simple. And yet, sometimes you find yourself writing lots of boilerplate code in every function to do common things, like parsing events, validation, loading parameters and lots more. The Middy.js framework was designed to help you keep Node.js Lambda function code simple, letting you focus on the business logic and clearing away duplication and boilerplate. By the end of this episode, you will know: How Middy.js works with JavaScript and TypeScript, how to perform validation, event parsing and parameter loading, and how you can even write and use your own Middy middleware. Finally you’ll get to know who is using Middy and how you could contribute to the Middy ecosystem. In this episode, we mentioned the following resources: - Middy Website and documentation: https://middy.js.org/ - How to get started with middy (official docs): https://middy.js.org/docs - Middy official middlewares (official docs): https://middy.js.org/docs/middlewares/intro - How to write your own middlewares (official docs): https://middy.js.org/docs/category/writing-middlewares - Middy integrations (official docs): https://middy.js.org/docs/category/integrations - Interview with Taco Bell in an episode of Real World Serverless where they mention how they use middy: https://www.listennotes.com/podcasts/real-world/56-serverless-at-tacobell--k5gAQBMHSb/ - Open source projects using Middy: https://github.com/middyjs/middy/network/dependents?package_id=UGFja2FnZS00Njc1NDUzOTU%3D - Lambda Power Tools for TypeScript Middy Integration: https://awslabs.github.io/aws-lambda-powertools-typescript/0.10.0/core/logger/#capturing-lambda-context-info This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #serverless #lambda
undefined
Jun 9, 2022 • 29min

40. What do you need to know about IAM?

Identity Access Management, also known as IAM, can be an intimidating service when getting started with AWS. But IAM is also one of those core services that you can’t really avoid. In this episode we try to distill down everything that you need to know to understand IAM and start to use it proficiently. We cover what IAM is, why it is so important, how authentication and authorization work, what policy documents are and how to write them, how a user or an application get credentials to interact with AWS and finally many examples, tips and tricks. In this episode, we mentioned the following resources: - IAM access analyzer:  https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html - Our previous episode on how to manage AWS credentials: https://www.youtube.com/watch?v=X4uA6EtNyos - Understanding how IAM Policies work (AWS Docs): https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html - Policy simulator: https://policysim.aws.amazon.com/ - Policy evaluation logic (AWS Docs): https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html - How the Signature v4 (sigv4) algorithm works (AWS Docs): ​​https://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html - Actions, resources, and condition keys for AWS services - https://docs.aws.amazon.com/service-authorization/latest/reference/reference_policies_actions-resources-contextkeys.html - Video IAM Concepts by beabetterdev: https://www.youtube.com/watch?v=_ZCTvmaPgao - Re:Invent session “Getting started with AWS identity” by Becky Weiss: https://www.youtube.com/watch?v=Zvz-qYYhvMk - Re:Invent session “Become an IAM Policy Master in 60 Minutes or Less” by Brigid Johnson:  https://www.youtube.com/watch?v=YQsK4MtsELU This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige
undefined
Jun 2, 2022 • 23min

39. How do you build a cross-account event backbone with EventBridge?

When it comes to building and deploying microservice applications on AWS, there are 2 emerging best practices: use a separate AWS account per application (and environment) and decouple communication between separate systems using events (instead of point-to-point communication). Can we use these two best practices together? Yes, but we will need to find a way to pass messages between AWS accounts! In this episode we discuss how to do that using EventBridge as a cross-account event backbone! We discuss why these 2 suggestions are well established best practices, what are the pros and cons that they bring to the table, what an event backbone is and why EventBridge is a great service to implement one. Finally, we will discuss a case study and an example implementation of this pattern in the context of an e-commerce application built with a microservices architecture. In this episode, we mentioned the following resources: - Article “How to use EventBridge as a Cross-Account Event Backbone” https://dev.to/eoinsha/how-to-use-eventbridge-as-a-cross-account-event-backbone-5fik - Repository with example code: https://github.com/fourTheorem/cross-account-eventbridge/ - Article “What can you do with EventBridge?” (fourTheorem blog): https://www.fourtheorem.com/blog/what-can-you-do-with-eventbridge - For great ideas on structuring event payloads, take a read of Sheen Brisals' post on the Lego Engineering blog: https://medium.com/lego-engineering/the-power-of-amazon-eventbridge-is-in-its-detail-92c07ddcaa40 - Article “What do you need to know about SNS?” (fourTheorem blog) which includes a comparison of SNS and EventBridge: https://www.fourtheorem.com/blog/what-do-you-need-to-know-about-sns - AWS Bites Episode 23: “What’s the big deal with EventBridge?” : https://youtu.be/UjIE5qp-v8w - AWS Community Day talk by Luc van Donkersgoed “Event-Driven Architecture at PostNL Scale” https://www.youtube.com/watch?v=nyoMF1AEI7g This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #microservice #eventbridge
undefined
May 26, 2022 • 29min

38. How do you choose the right compute service on AWS?

When it comes to choosing compute services on AWS, there are a lot of options, including EC2, ECS, Lambda, EKS… New ones keep emerging all the time! Selecting the right one for each application is no longer an easy choice. In this episode we discuss why you need compute services and what kinds of problems should be offloaded to something else entirely. We suggest how you can develop a methodology to make the selection process easier and less biased within your company. We discuss at a high level what are some of the different compute options available in AWS and finally we provide a few different options example use cases and describe how we picked the compute service for each. In this episode, we mentioned the following resources: - InfoQ article “A Recipe to Migrate and Scale Monoliths in the Cloud”: https://www.infoq.com/articles/cloud-migrate-scale/ - Our previous episode about migrating monoliths to the cloud: https://www.youtube.com/watch?v=GYa2RkYDfBQ - Article on choosing the right compute service: https://www.fourtheorem.com/blog/aws-compute This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #compute #lambda
undefined
May 19, 2022 • 32min

37. How do you migrate a monolith to AWS without the drama?

Migrating monolithic applications to the cloud doesn’t have to be a nightmare. Discover strategic approaches that minimize change while enhancing scalability and resilience. Learn about the importance of infrastructure as code and effective database migration techniques. The podcast also highlights the challenges of managing monoliths on a single server and discusses network fundamentals for secure deployments. Get ready for insightful tips on team preparation and operational skills to navigate cloud transformation smoothly!
undefined
May 12, 2022 • 24min

36. What’s new for JavaScript developers on AWS?

There are lots of options for programming languages on AWS these days but one of the most popular ones remains JavaScript. In this episode of AWS Bites we discuss what it’s like to develop with JavaScript, Node.js and TypeScript on AWS and what’s new in this field. We explore why you would choose JavaScript and what are the trade-offs that come with this choice. We present some of the main features of the all-new AWS SDK v3 for JavaScript. We discuss runtime support and tooling for AWS Lambda and finally some interesting developments in the JavaScript ecosystem for the cloud and AWS. - Our previous episode on What language to use for lambda: https://www.youtube.com/watch?v=S0tpReRa6m4 - AI as a Service by Eoin Shanaghy and Peter Elger (book): https://www.manning.com/books/ai-as-a-service - Node.js Design Patterns by Mario Casciaro and Luciano Mammino (book): https://www.nodejsdesignpatterns.com/ - AWS SDK for JavaScript v3 high level concepts (including command based model): https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html#high-level-concepts - AWS SDK for JavaScript v3 paginators using Async Iterators: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html#paginators - Mocking support for the AWS SDK for JavaScript v3: https://aws.amazon.com/blogs/developer/mocking-modular-aws-sdk-for-javascript-v3-in-unit-tests/ - Various interesting benchmarks on different Lambda runtimes: https://github.com/theam/aws-lambda-benchmark - https://filia-aleks.medium.com/benchmarking-all-aws-lambda-runtimes-in-2021-cold-start-part-1-e4146fe89385 - https://www.simform.com/blog/aws-lambda-performance/ - Support for ESM modules in AWS Lambda (Node.js 14): https://aws.amazon.com/about-aws/whats-new/2022/01/aws-lambda-es-modules-top-level-await-node-js-14/ - The Middy Framework (middleware pattern for AWS Lambda): https://middy.js.org/ - Lambda Power Tools library for TypeScript: https://awslabs.github.io/aws-lambda-powertools-typescript/ - Yan Cui’s article on performance improvements with bundling: https://lumigo.io/blog/3-major-ways-to-improve-aws-lambda-performance/ - ZX project (scripting with JavaScript) by Google: https://github.com/google/zx Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige
undefined
May 5, 2022 • 32min

35. How can you become a Logs Ninja with CloudWatch?

In the age of distributed systems we produce tons and tons of logs. This is especially true for AWS when using CloudWatch logs. So how do we make sense of all these logs and how can we find useful information in them? In this episode we talk all about logs on AWS and we discuss the main concepts in CloudWatch for logs like Log Groups and Log Streams. We discuss how you can consume logs and how this used to be a big pain point with AWS CloudWatch logs and how now things are a lot better thanks to a relatively new feature called Log Insights. Finally we discuss some best practices that you should consider when thinking about logs for your distributed cloud applications. In this episode, we mentioned the following resources: - Our previous episode on CloudWatch alarms: https://www.youtube.com/watch?v=rk4QMJf6R4U - Analyzing log data with CloudWatch Logs Insights: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html - CloudWatch logs insights query syntax: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html - Pino logger for Node.js: https://getpino.io This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #logs #cloudwatch
undefined
Apr 28, 2022 • 27min

34. How to get the most out of CloudWatch Alarms?

CloudWatch is a great service for metrics. You get tons of metrics out of the box and you can also create your custom ones. One of the most important things you can do with metrics is to create alarms, so how do we get the most out of CloudWatch alarms? In this episode we share our insights and cover the different types of alarms that exist, how to create an alarm, what to do when an alarm is triggered, a few examples of useful alarms and some of the drawbacks of CloudWatch alarms and how to overcome them. In this episode, we mentioned the following resources: - Our previous episode on CloudWatch metrics: https://www.youtube.com/watch?v=vwo2jXfyooQ - SLIC Watch, a serverless framework plugin that generates sensible alarms and dashboard automatically: https://fth.link/slic-watch This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #alarms #cloudwatch
undefined
Apr 21, 2022 • 33min

33. What can you do with CloudWatch metrics?

CloudWatch is the main Observability tool in AWS and it offers a wide range of features: logs, metrics, dashboards, alarms and even events (recently moved into EventBridge). In this episode we are going to focus on CloudWatch metrics. We are going to discuss the characteristics of metrics in CloudWatch: namespaces, dimensions, units and more. What metrics you get out of the box and how to create your own. How to access and explore metrics. Finally we will compare CloudWatch to other providers like DataDog, New Relic, Honeycomb and Grafana + Prometheus and try to assess whether CloudWatch is enough or if you need to use other third-party services. In this episode, we mentioned the following resources: - How to send Gzipped requests with boto3 (which uses the PutMetricsData API as an example): https://loige.co/how-to-send-gzipped-requests-with-boto3 - CloudWatch service quota: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html - CloudWatch metrics stream for DataDog: https://www.datadoghq.com/blog/amazon-cloudwatch-metric-streams-datadog/ This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige
undefined
Apr 14, 2022 • 25min

32. What are the benefits of tags?

What are the benefits of Tags? You have probably seen that you can add tags to almost every resource in AWS… but should you really do it? And if you do it, what are the benefits? In today’s episode Eoin and Luciano cover what tags are, some examples of how to use them and what kind of benefits they can give you and your team. Finally we’ll give you a bunch of ideas on how to build a tagging strategy and get value from tags! In this episode, we mentioned the following resources: - Resource group tagging (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/overview.html) - Controlling access to AWS resources using tags https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html - Enforce tagging via SCP (Service Control Policies): https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_tagging.html#example-require-tag-on-create - Use AWS Config to create rules that can alarm if some resources are not compliant: https://aws.amazon.com/premiumsupport/knowledge-center/config-resource-non-compliant/ - Example on how to use CloudTrail to automatically tag newly created resources: https://aws.amazon.com/blogs/mt/auto-tag-aws-resources/ - Archived AWS white paper on tagging best practices: https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf This episode is also available on YouTube: https://www.youtube.com/AWSBites You can listen to AWS Bites wherever you get your podcasts: - Apple Podcasts: https://podcasts.apple.com/us/podcast/aws-bites/id1585489017 - Spotify: https://open.spotify.com/show/3Lh7PzqBFV6yt5WsTAmO5q - Google: https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy82YTMzMTJhMC9wb2RjYXN0L3Jzcw== - Breaker: https://www.breaker.audio/aws-bites - RSS: ​​https://anchor.fm/s/6a3312a0/podcast/rss Do you have any AWS questions you would like us to address? Leave a comment here or connect with us on Twitter: - https://twitter.com/eoins - https://twitter.com/loige #aws #tags #cloudformation

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app