Skip to content

Commit ae153fe

Browse files
sir-sigurdclaude
andcommitted
Add cnames to the smoke wrapper as a cross-module provider guard
The quilt/cnames provider conflict went unnoticed because CI only ever validates each module standalone — no job composed two modules in one root, so their combined AWS provider constraints were never resolved. Compose `cnames` alongside `quilt` in the smoke wrapper so the test job's `terraform init` resolves both modules' constraints together. A future incompatible pin on either module now fails init in CI (verified: reverting cnames to `~> 5.0` makes this wrapper's init fail). Also drops the now-stale cnames note from the root provider-pin comment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5a1378f commit ae153fe

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

modules/quilt/tests/smoke/main.tf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ terraform {
1616
source = "hashicorp/aws"
1717
# Match what the modules under test transitively require: the
1818
# terraform-aws-modules/vpc ~> 6.0 module needs aws >= 6.28. Pinning keeps
19-
# CI deterministic and off a future major. (Note: examples/main.tf and
20-
# modules/cnames still pin ~> 5.0, which is incompatible with that floor.)
19+
# CI deterministic and off a future major.
2120
version = "~> 6.0"
2221
}
2322
}
@@ -87,6 +86,20 @@ module "quilt" {
8786
user_subnets = var.user_subnets
8887
}
8988

89+
# Compose `cnames` in the same root as `quilt` so CI resolves their combined
90+
# AWS provider constraints at init. This is the regression guard for the
91+
# quilt (vpc → aws >= 6.28) vs cnames conflict: a future incompatible pin on
92+
# either module fails `terraform init` here. Inputs are literal dummies — the
93+
# guard is provider resolution + plan wiring, not value flow from the (mocked)
94+
# quilt outputs.
95+
module "cnames" {
96+
source = "../../../cnames"
97+
98+
zone_id = "Z00000000000000000000"
99+
quilt_web_host = "quilt-test.example.com"
100+
lb_dns_name = "test-lb.example.com"
101+
}
102+
90103
# Re-expose ONLY the non-sensitive stack name. Do not output module.quilt.stack
91104
# (it embeds the DB URL + admin password) or any *_password value — a sensitive
92105
# root output makes `terraform test` fail, which is the whole reason this

modules/quilt/tests/smoke/smoke.tftest.hcl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Plan-only with the AWS provider mocked: no credentials, no infrastructure.
55
# Exercises the full wiring (vpc + db + search + the CloudFormation stack), so
66
# a change that breaks the public boundary or the vpc pass-through fails in CI.
7+
# The wrapper also composes the `cnames` module (see main.tf), so an AWS
8+
# provider constraint that can't resolve across quilt + cnames fails at init.
79
#
810
# Assertions reference known inputs (the stack name), not mocked computed
911
# attributes, whose generated values are intentionally arbitrary.

0 commit comments

Comments
 (0)