Subscribe free
Morning Merge DevOps · Monday, November 23, 20263 min read

Rehearse Terraform applies on the AWS Emulator

Also: GitHub Actions accepts invalid YAML, Vercel flag checks, Nango on token refresh

A thin Monday: three items, all about the gap between what your tooling reports and what production actually does.

Rehearse the apply

A gantry sets a cobalt rehearsal rack on a test platform beside live racks

A practitioner write-up runs Terraform applies against the AWS Emulator before they reach real AWS. The problem is familiar: plan comes back green, apply fails on a resource that can't be changed, and you open another pull request to try again.

Plan can't know what already exists or how an API will react. The author's example is upgrading an RDS PostgreSQL instance from version 14 to version 18 without an explicit "apply immediately" flag.

So the pipeline becomes plan, apply against the emulator, then apply to AWS. Jobs run a little longer. The author's applies run on commits to main after a PR, and the rehearsal saves opening a new branch just to fix a failed apply.

Most of the setup is provider config. Point each service endpoint at the emulator, skip the credential, region and metadata checks, and set insecure = true for its self-signed certificate. The author built the Docker image, all 1.24GB of it, and ran it on port 9297.

Read the startup log before copying this into CI. The emulator listens on 0.0.0.0 unless you pass -b 127.0.0.1. The author turned request authentication off with -a off. Telemetry is on by default, and EMULATOR_TELEMETRY=off disables it.

Hacker News commenters found the soft spots. The emulator replicates the API, not the service logic behind it. One points out that the post's motivating case, a bucket name that's already taken, is one the emulator can't know about either, since bucket names are global.

Another warns that the example passes credentials as TF_VAR_ variables, which end up in the state file.

Use the rehearsal to catch ordering and parameter mistakes, not as proof the real apply will work.

CI and deploy gates

A gantry inspects a pipe run where one cobalt fitting sits out of alignment

GitHub Actions accepts YAML that a conforming parser rejects, which is why zizmor has choked on some real workflows since zizmor#1116 was filed. The trigger is a multi-line single-quoted string whose closing line isn't indented past its parent key. YAML 1.2.2 § 8.2.3 requires at least one more space, so the fix is one space.

The author thinks Actions parses with YamlDotNet 5.3.0, released in 2018, and that even 18.1.0 still accepts the single-quoted form. If a strict linter rejects a workflow that runs fine, check that indentation before blaming the linter.

Vercel Flags can now block a production deployment when code declares a flag your project hasn't created. Without the definition, the app silently falls back to the flag's default, which can turn on a feature you meant to keep off.

The Flag Definitions Present Deployment Check reads your Flags SDK discovery endpoint and needs FLAGS_SECRET set. It's on all plans; mark it required in Build and Deployment settings to make it block.

Worth a read

A gantry carries a cobalt baton along an overhead rail between two server racks

Nango lost refreshed OAuth tokens for hundreds of connections in May 2025. A merged bug stopped refreshed credentials from being saved, and the revert came in just under two hours. Providers that rotate refresh tokens, including Airtable and Atlassian, had already invalidated the old ones, so users had to reconsent.

Nango's rule now is to treat refresh tokens like money, not cache. The new token gets persisted before anything else can fail, that path has its own regression tests, refresh anomalies page on-call, and refreshes are serialized per connection behind a distributed lock.

The provider quirks are the useful part for anyone running integrations. Exact Online rejects refreshes more than 30 seconds before expiry, so a "refresh 15 minutes early" rule failed every time.

Zoho CRM's token endpoint returns HTTP 200 with the error in the body, and Workday and Dayforce return empty data when a permission policy is missing. If your alerts only fire on 401s, those failures never page anyone.

If your Terraform apply only runs after merge, try a rehearsal stage this week, and don't read a green emulator run as a green light.

← All Morning Merge DevOps issues

Get this in your inbox every morning.

Free. Five minutes. Unsubscribe in one click.

Subscribe free →