terraform test, and the module that had no assertions

A testing framework in 1.6, usable in 1.7, and a module that had been verified by applying it and looking.

# tests/defaults.tftest.hcl
run "applies_sensible_defaults" {
  command = plan

  variables {
    name = "app"
  }

  assert {
    condition     = aws_s3_bucket.this.bucket == "app-uploads"
    error_message = "bucket name is not derived from the name variable"
  }
}

command = plan asserts against the plan without creating anything, which is what makes this cheap enough to run in CI on every change. Tests that use apply create real infrastructure and destroy it afterwards, which is genuinely useful and belongs on a schedule rather than on a pull request — and needs an account nobody minds seeing odd resources appear in.