Rename resources, move them into a module, adopt hand-built ones and stop managing others, all without Terraform destroying anything. Runnable demo with moved, removed and import blocks on Terraform 1.17.
Buffered and unbuffered channels, closing them, select with timeouts, WaitGroup.Go, a mutex the race detector is happy with, a bounded worker pool and errgroup. Runnable Go 1.27 examples and an exercise at the end.
Part 5 of the shorty series: a GitHub Actions CI workflow for a Go service. golangci-lint v2 with a config that fits, go test with the race detector against a real Postgres service container, setup-go caching, and a coverage summary on every pull request.
A private S3 bucket behind CloudFront with Origin Access Control, an ACM certificate from us-east-1 validated by hand at a non-Route 53 registrar, clean URLs with a CloudFront Function and a deploy script that invalidates the cache.
The same Go pipeline for shorty (lint, test with Postgres and the race detector, build and push an image) written for GitHub Actions and for GitLab CI, with every concept mapped across.
A rate limiter that lives inside one process breaks the moment you run three copies of the API. Here is a token bucket shared through Redis, made atomic with a Lua script, with a Go middleware and a plan for when Redis is down.
Running PgBouncer 1.26 in front of Postgres 18 in Docker: why raising max_connections isn't the fix, transaction vs session pooling, the session state that leaks between clients, prepared statements with pgx, and RDS Proxy as the managed option.
Move shorty's settings into a ConfigMap and a Secret, add startup, liveness and readiness probes, and set memory requests and limits on a kind cluster. With the mistakes I hit: config that didn't reload and a liveness probe that restarted every pod.
The same shorty network built for dev, staging and prod twice: once with Terraform workspaces and once with a folder per environment. Where each state file ends up in S3, the guard I added for the default workspace, and why I pick directories.
Packages and modules in Go 1.27: go mod init and tidy, go.sum, exported names, internal/, versions and /v2 paths, replace for local work, go work workspaces and tool dependencies, all run for real with the output I got, plus an exercise.
Part 4 of the shorty series: hardening the Go container image. A static binary on distroless instead of scratch or alpine, a numeric non-root user, no shell, a read-only root filesystem, all capabilities dropped and the base image pinned by digest.
One VPC across two availability zones in Terraform, with public and private subnets, route tables, and three ways to get the private side online: a NAT gateway, a NAT instance or VPC endpoints, with Mumbai prices for each.