Posts

How to Create a Lambda Layer for Shared Python Libraries

You have three Lambda functions, each packaging the same requests library independently. Every deploy zips the same 15 MB, every cold start loads the same bytes, and when you need to pin a new version you touch three functions instead of one. Lambda Layers exist precisely to break this pattern — one versioned artifact, attached to as many functions as you need. TL;DR: Lambda Layer Creation at a Glance Step What Happens Key Detail 1. Build package locally pip installs into a directory matching the Lambda runtime path Must be python/ subdirectory 2. Zip the directory Creates the layer artifact Zip must contain python/ at root 3. Publish layer version Lambda stores the artifact and returns a versioned ARN Each publish creates a new immutable version 4. Attach to functions Function config references the layer ARN Up to 5 layers per function; combined unzipped size limit applies How Lambda Layers Work...

How to Use S3 Intelligent-Tiering to Automatically Reduce Storage Costs

You have objects in S3 with unpredictable access patterns — some files get hit constantly for a week, then go cold for months. Manually managing lifecycle rules for this kind of workload is a losing battle, and that's exactly the problem S3 Intelligent-Tiering was built to solve. TL;DR: S3 Intelligent-Tiering at a Glance Question Answer What does it do? Automatically moves objects between access tiers based on observed access patterns Retrieval fees? None for Frequent and Infrequent Access tiers. Archive tiers have retrieval latency but no retrieval fee. Monitoring fee? Per-object monthly fee applies to objects 128 KB and larger Minimum object size for cost benefit? 128 KB — smaller objects are not charged the monitoring fee but also don't benefit from tiering savings Best fit? Unpredictable or mixed access patterns where lifecycle rules are impractical Worst fit? Workloads with known, s...

How to Connect RDS PostgreSQL from Lambda Using Python and Parameter Store

You've got a Python Lambda that needs to query a PostgreSQL RDS instance — straightforward on paper, but the moment you try to import psycopg2 , Lambda throws a module-not-found error, and you realize the database password sitting in an environment variable is a security incident waiting to happen. This post walks through building a working psycopg2 Lambda layer, wiring up the VPC networking, and pulling credentials securely from AWS Systems Manager Parameter Store. TL;DR: Lambda to RDS PostgreSQL Connection Problem Solution psycopg2 not available in Lambda runtime Build a Lambda Layer with the compiled binary using Docker Database password in plaintext env var Store as SecureString in SSM Parameter Store, fetch at runtime Lambda cannot reach RDS Deploy Lambda in the same VPC, configure Security Group rules Cold start latency from SSM calls Cache the parameter value in the Lambda execution context ...

What Is an AWS Availability Zone and Why You Must Deploy Across Multiple AZs

You're setting up an EC2 instance or an RDS cluster in Seoul, and the console asks you to pick between ap-northeast-2a and ap-northeast-2c . Most engineers pick one and move on — until a 3 AM alert tells them their entire application is unreachable because that single AZ had a power event. Understanding what an Availability Zone actually is, and what happens when one fails, is the difference between a five-minute failover and a multi-hour outage. TL;DR: Availability Zones and Multi-AZ Deployment Topic Key Point What is an AZ? One or more discrete data centers with independent power, cooling, and networking within a Region AZ failure scope Failures are isolated to a single AZ — neighboring AZs in the same Region are unaffected Single-AZ risk Any AZ-level event (power, hardware, networking) takes your entire application offline Multi-AZ benefit Traffic automatically shifts to healthy AZs; your app surv...

How to Deploy a React App to S3 and CloudFront Using GitHub Actions

Every time you push to main, you want your React app built and live — not a manual aws s3 sync from your laptop. Setting up a GitHub Actions workflow that runs npm run build and deploys to S3 with CloudFront invalidation is straightforward once you understand the IAM surface and the ordering of operations. Get either wrong and you end up with stale cache or a pipeline that works on your machine but fails in CI. TL;DR: React App Deployment to S3 and CloudFront Phase Tool Key Action Build GitHub Actions + Node npm ci && npm run build Upload AWS CLI aws s3 sync ./build s3://your-bucket --delete Invalidate CloudFront API aws cloudfront create-invalidation Auth OIDC (recommended) No long-lived AWS credentials in GitHub Secrets How the Deployment Pipeline Works Before writing a single line of YAML, it helps to understand what actually happens between a git push and a user seeing updated conten...