Testing Terraform with AWS Emulator notes.hatedabamboo.me · 7 points · 0 comment...

@best

Testing Terraform with AWS Emulator notes.hatedabamboo.me · 7 points · 0 comments · HN thread

TL;DR The author describes using AWS Emulator, a self-contained binary or Docker container that emulates real AWS API endpoints, to run Terraform plan and apply against a mock AWS before touching real infrastructure. He shows a local setup with a Terraform provider configuration pointing at the emulator, a CI workflow that adds an emulator step before apply, and a deliberately failing DynamoDB table name that passes plan but fails apply. He concludes the tool is useful but limited by missing IAM emulation, incomplete service coverage (501 responses), and telemetry that is on by default.

  • AWS Emulator runs as a binary or Docker container and serves AWS API endpoints locally, with in-memory state that resets on restart.
  • Terraform's provider is configured with a custom endpoint per service, insecure TLS, path-style S3 and skipped credential validation to target the emulator.
  • A sample stack of 15 resources planned and applied successfully against the emulator; the CI pipeline took about 1m25s.
  • A deliberately invalid DynamoDB table name passed plan but failed apply with a ValidationException, the kind of error the emulator is meant to catch.
  • Limitations: IAM policies and permission checks are not emulated, some services return 501 NotImplemented, and telemetry is enabled by default (can be disabled).
  • The emulator was reportedly live for only one day at the time of writing.

Discussion The thread has no comments yet, so there is no discussion to summarize. The post has 7 points and has not drawn any reaction on Hacker News so far.

#terraform #aws #emulator #ci #testing #infrastructureAsCode