DevOps Bulletin #86: Serverless Testing
Tags: aws, kubernetes, devops, docker
Published: 2023-01-20 17:05:59

This week, we’re diving deep into the world of serverless and exploring the latest techniques for testing and cost optimization. Are you tired of mocking AWS SDK calls when testing your serverless functions? We’ve got you covered with a new approach to serverless testing that doesn’t require mocking. Plus, we’ll show you how to keep your costs in check with serverless MongoDB Atlas.

But that’s not all, have you ever wondered how a hacker can waste $13000 on your AWS account? We’ll take a look at a real-life example and share the steps you can take to prevent this from happening to you.

We’ll also explore some of the latest developments in Kubernetes, including a deep dive into DNS and service discovery and tips on how to detect insecure VSCode extensions. Additionally, we’ll share some of our favorite open-source DevOps tools of the week and discuss the ongoing debate around Platform Engineering vs DevOps is Dead. Don’t miss out on our coverage of finding active resources in your AWS account, building AWS Lambda layers with AWS CDK, and how to fix common issues in Kubernetes clusters.

## Headline Tutorials:

![Testing Serverless architecture](https://miro.medium.com/max/700/0*-Rnfbhsk6zfpcMQW)

🧪 “[Serverless testing: simplify testing with SOLID architecture](https://blog.walmsles.io/serverless-testing-part-3-simplify-testing-with-solid-architecture?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — Post on Testing Serverless architectures using SOLID and Hexagonal software architecture principles without needing to mock AWS SDK calls at all!

💸 “[Avoid bankruptcy while using serverless MongoDB Atlas](https://medium.com/@ogowm/avoid-becoming-bankrupt-while-using-serverless-mongodb-atlas-9cc70093476c?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — Several best practices to avoid financial issues such as: setting up an alert system to monitor usage, properly configuring the data storage, and using the MongoDB Atlas’s auto-scaling feature.

💰 “[It happened to me: how I suddenly owed AWS $13,000…](https://thenewstack.io/my-account-was-hacked-and-suddenly-i-owed-aws-13000/?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — The hack could have been avoided if they had set up Multi-factor Authentication (MFA), CloudTrail, and Budgets from the start.

👀 “[A debugging story: a bug in the S3 API](https://terrateam.io/blog/debugging-aws-s3-import?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — The AWS S3 API has a bug in it where if the configuration is modified on create, the API responds with 404 for those attributes.

💡 “[The life of a DNS query in Kubernetes](https://www.nslookup.io/learning/the-life-of-a-dns-query-in-kubernetes/?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — Understanding how DNS and service discovery work in Kubernetes can be helpful for debugging issues.

🔒 “[Can you trust your VSCode extensions?](https://blog.aquasec.com/can-you-trust-your-vscode-extensions?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — The post covers how to detect and mitigate risks associated with malicious extensions and how to secure your development environment.

🛠 “[Build AWS Lambda layers with AWS CDK](https://www.ranthebuilder.cloud/post/build-aws-lambda-layers-with-aws-cdk?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — This blog post covers AWS Lambda layers basics and how to build them with Docker & AWS CDK in Python.

🤔 “[Platform Engineering as a startup](https://blog.symops.com/2023/01/05/platform-engineering-as-a-startup/?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — This article discusses the importance of internal tools, the evolution of the term “platform engineering,” and the challenges of aligning vendor and customer incentives in this space.

🔥 “[Komiser vs AWS Resource Explorer](https://www.tailwarden.com/blog/komiser-vs-aws-resource-explorer?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin)” — Finding resources within the AWS Console has been a tedious and often frustrating task, particularly for those who have a large number of resources and use multiple AWS regions. This has been the case for a long time … until the release of AWS Resource Explorer.

## Latest open source projects

### Basti

![Securely access DB instances in AWS](https://miro.medium.com/max/700/0*1flIca3P2zlgo0D8.gif)

[Basti](https://github.com/BohdanPetryshyn/basti?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) is a CLI tool for accessing DB instances and other AWS resources in private networks almost at no cost. You can securely connect to your RDS/Aurora/Elasticache/EC2 instances in private VPC subnets from a local machine or CI/CD pipeline.

### Adrenaline

![Code Debugger powered by OpenAI](https://miro.medium.com/max/700/0*Nzcjk4AKPbAa2UP9.png)

[Adrenaline](https://github.com/shobrook/adrenaline?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) is an open-source debugger powered by the OpenAI Codex. It not only fixes your code, but teaches you along the way.

### Copacetic

![Scan container images for security issues](https://miro.medium.com/max/624/0*RBL1W5aHPHbmyk-R.png)

[Copacetic](https://github.com/project-copacetic/copacetic?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) is a CLI tool for directly patching container images using reports from popular vulnerability scanners like Trivy.

### AWS Terraform Dev Container

![Manage AWS infrastructure with Terraform](https://miro.medium.com/max/700/0*675HANLcY9A1Hwbi.gif)

[AWS Terraform Dev Container](https://github.com/awslabs/aws-terraform-dev-container?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) is a vscode extension with tools to help you build and manage AWS infrastructure with Terraform.

### StepFunctions Workflow Studio Sync

![Enables real-time sync between StepFunctions Workflow Studio and your local machine](https://miro.medium.com/max/700/0*qEiXsTm8sJt-PN_r.gif)

A [Chrome extension](https://github.com/ljacobsson/sfn-workflow-studio-sync?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) that enables real-time sync between StepFunctions Workflow Studio and your local file system.

### Convox

![PaaS for AWS](https://miro.medium.com/max/700/0*G3mGqm36v3XCUntK.png)

[Convox](https://github.com/convox/rack?utm_source=newsletter&utm_medium=email&utm_campaign=devopsbulletin&utm_content=devopsbulletin) Rack is an open-source private PaaS that runs in your AWS account.

## Question of the week

![Testing in production](https://miro.medium.com/max/700/0*gAd4xoyi_ZvefBSZ.png)

Read [responses](https://news.ycombinator.com/item?id=34384656)

## Meme of the week

![DevOps meme](https://miro.medium.com/max/375/0*L-p6naOFinTRJiOx.png)

I hope this summary has been useful. Remember to [subscribe to the newsletter](https://www.devopsbulletin.com/) to receive the latest DevOps trends in your inbox every week 🔥