Posts

Building Type-Safe APIs with AWS API Gateway and TypeScript

Building robust APIs requires more than just handling HTTP requests—it demands type safety, proper validation, and clear documentation. In this post, we’ll explore how to build production-ready APIs using AWS API Gateway with TypeScript, ensuring type safety from request to response while maintaining excellent developer experience.

Why Type-Safe APIs Matter

Type safety in API development provides several critical advantages:

Building Event-Driven Architectures with AWS SNS/SQS and TypeScript

Event-driven architectures form the backbone of modern cloud applications, enabling systems to scale gracefully while maintaining loose coupling between components. This post explores how AWS SNS and SQS, combined with TypeScript’s type safety, create robust messaging patterns that handle everything from simple notifications to complex distributed workflows.

Event-Driven Architecture Benefits

Event-driven systems offer compelling advantages for modern applications. Loose coupling allows services to evolve independently without breaking dependencies. Natural scalability emerges as components can scale based on their specific load patterns rather than system-wide peaks. Resilience improves through built-in buffering and retry mechanisms that handle traffic spikes and temporary failures gracefully.

Securing AWS Lambda Functions: Best Practices and Implementation Guide

Following our exploration of AWS Lambda with TypeScript and Step Functions, it’s crucial to understand how to properly secure your serverless applications. Security in serverless architectures requires a different approach from traditional applications, as the infrastructure is managed by AWS while you maintain responsibility for securing your application logic and data.

Understanding the Shared Responsibility Model

In the AWS Lambda context, the shared responsibility model takes on a unique form. AWS handles the security of the runtime environment, execution environment isolation, and underlying infrastructure. However, developers are responsible for securing their application code, managing IAM permissions, protecting sensitive data, and ensuring secure communication between services. This division of responsibility allows you to focus on application-specific security while AWS handles the infrastructure security.

AWS Step Functions with TypeScript: Orchestrating Serverless Workflows

Building robust serverless applications often requires orchestrating multiple Lambda functions into complex workflows. AWS Step Functions provide a visual workflow service that coordinates distributed components, manages state transitions, and handles error recovery—all while maintaining the reliability and scalability that modern applications demand.

Why Step Functions with TypeScript?

TypeScript brings compelling advantages to Step Functions development beyond basic type safety. Workflow clarity emerges from strongly-typed state definitions that make complex logic easier to understand and maintain. Error prevention occurs at compile time through type checking of state inputs and outputs. Developer experience improves dramatically with IntelliSense support for AWS SDK calls and state machine definitions.

AWS Lambda with TypeScript: A Complete Development Guide

AWS Lambda represents the foundation of serverless computing, allowing you to run code without managing servers. When combined with TypeScript, Lambda functions become more maintainable, reliable, and developer-friendly. This guide will walk you through building production-ready Lambda functions with TypeScript, covering everything from setup to deployment and best practices.

Why TypeScript for Lambda?

TypeScript brings several compelling advantages to Lambda development. Type safety catches errors at compile time rather than runtime, preventing costly production issues. Enhanced developer experience includes intelligent autocomplete, refactoring support, and better tooling integration. Better maintainability comes from explicit interfaces and self-documenting code that’s easier for teams to understand and modify.

git reset to a given commit

Safely Resetting to a Previous Commit in Git

When working with Git, sometimes you need to reset your working tree to a specific commit while preserving the commit history. This guide explains how to do this safely and understand what’s happening behind the scenes.

The Problem

Typically, when developers want to revert to an older commit, they might reach for git reset --hard. However, this can be dangerous as it:

Decompiling dotnet apps

Sometimes as developers we run into a legacy application that has been running in production for years when suddenly a bug surfaces. If nobody knows where the source code for that legacy application is, that can be a huge problem.

Introduction to .NET Decompilation

Decompilation is the process of converting compiled .NET assemblies (DLLs or EXEs) back into readable source code. This can be incredibly useful when:

  • Dealing with legacy applications without source code
  • Debugging production issues where deployed code differs from source control
  • Understanding third-party libraries when documentation is insufficient
  • Investigating potential security issues or malware

Using dotPeek

dotPeek by JetBrains is a powerful free .NET decompiler that can help solve these problems. I recently had an occasion to use it, and even without the .pdb file, it was able to decompile the code to be very close to the source code we had in source control that we knew wasn’t what was running in production.