upvote
Testing Terraform with AWS Emulator

(notes.hatedabamboo.me)

Nice. Now for GCP to also release such a tool
reply
The problem with testing with Terraform or any other tool is that the emulator won't accurately reflect real-world behavior. The real world services have a bunch of logic and code of them which isn't all replicated in the emulator. The only thing the emulator does is replicate the API. It's a bit like trying to build a model of a house by building the model to look like the outside of the house. Gives you an idea what it looks like, but working within that model is not going to be the same as working within the actual house.
reply
Most teams I've been on have used a pre-production environment for a combination of performance testing and making sure infra worked as expected. To a smaller degree with less instances etc, we use our dev and test environments to make sure infra works the same as it should in higher envs.
reply
Agreed. We also have a fair amount of TF testing involving IAM to make sure we get permissions right which the emulator doesn’t emulate at all unfortunately.
reply
The problem with full e2e tests for Terraform is that they are 1. Extremely slow 2. Can be expensive.

LocalStack and hopefully the new AWS Emulator can give you a fairly high degree of confidence.

reply