Bump modules/cnames AWS provider constraint to ~> 6.0 - #117
Conversation
The cnames module pinned aws `~> 5.0` (< 6.0), but it is used alongside the vpc module, whose `terraform-aws-modules/vpc ~> 6.0` dependency requires aws >= 6.28. A root using both modules (the topology `examples/main.tf` documents) failed `terraform init` with an unsatisfiable provider constraint. Widen to `>= 5.79, < 7.0` so it resolves into 6.x while still blocking the next major — completing the registry-pinning reconciliation started in #110/#112. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@greptileai please review |
There was a problem hiding this comment.
Pull request overview
This pull request widens the hashicorp/aws provider constraint in modules/cnames to eliminate an unresolvable version intersection when cnames is used alongside quilt/vpc-dependent module trees that require AWS provider 6.x.
Changes:
- Relax
modules/cnamesAWS provider version constraint from~> 5.0to>= 5.79, < 7.0(allowing both 5.x and 6.x). - Add an Unreleased CHANGELOG entry documenting the fix and the previously failing
terraform initscenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| modules/cnames/main.tf | Broadens the AWS provider constraint to span 5.x–6.x to avoid conflicts with vpc’s transitive aws >= 6.28 floor. |
| CHANGELOG.md | Records the provider-constraint relaxation under Unreleased. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Match the registry-pinning convention (~>) used by the vpc module rather than a bare range; the rationale lives in the CHANGELOG and PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@greptileai the constraint was changed from |
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>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@greptileai this PR now also adds a cross-module provider guard (composes |
Description
modules/cnamespinnedaws ~> 5.0(i.e.< 6.0), but it is used in the same root asmodules/quilt— whoseterraform-aws-modules/vpc ~> 6.0dependency requiresaws >= 6.28. The two constraints have no overlap, so any root using both modules (the topologyexamples/main.tfdocuments) failsterraform init:This is the loose end of the registry-pinning sweep in #110/#112:
vpcandsecurity-groupwere reconciled into the 6.x/5.x world, butcnames'sawsconstraint was never brought along. The break is upstream-timed —vpc6.0.0 only requiredaws >= 5.79(compatible with~> 5.0); it activated once the upstream module raised its floor past 6.0.cnamesonly managesaws_route53_record, which is stable across aws 5.x and 6.x, so bumping it to~> 6.0(matching thevpcmodule) is safe and lets it resolve into 6.x alongsidevpc.Verified locally — a root combining
vpc+cnamesnow resolves (aws v6.49.0) where it previously failedinit.It also adds a regression guard: the
quiltsmoke-test wrapper now composescnamesin the same root, so CI'sterraform initresolves both modules' AWS provider constraints together. No CI job did that before — each module is validated standalone — which is why this conflict went unnoticed across releases. A future incompatible pin on either module now fails CI at init.TODO
Greptile Summary
This PR fixes a Terraform provider constraint conflict where
modules/cnamespinnedaws ~> 5.0whilemodules/quilt's transitive dependency (terraform-aws-modules/vpc ~> 6.0) requiresaws >= 6.28, making the two constraints irresolvable in a shared root. The fix bumpscnamesto~> 6.0and adds a regression guard by composingcnamesinto thequiltsmoke-test wrapper so future constraint divergence fails CI atterraform init.modules/cnames/main.tf: Single-line bump from~> 5.0to~> 6.0;aws_route53_recordis stable across both major versions so no resource changes are needed.modules/quilt/tests/smoke/main.tf: Adds amodule \"cnames\"block with valid dummy inputs (all required variables supplied,ttlhas a default) to make init exercise both modules' provider constraints together.CHANGELOG.md/smoke.tftest.hcl: Changelog entry and updated test header comment to document the guard.Confidence Score: 5/5
Safe to merge — single-line provider constraint bump with no resource changes and a well-constructed regression guard added to CI.
The fix is minimal and surgical: aws_route53_record has no breaking changes between aws 5.x and 6.x, so bumping the constraint carries no operational risk. The dummy inputs in the smoke wrapper are all valid (required variables supplied, ttl defaults to 60, the quilt_web_host regex matches the supplied value), so the plan-only mocked tests will continue to pass. The regression guard correctly closes the gap that allowed this conflict to go undetected across prior releases.
No files require special attention.
Important Files Changed
~> 5.0to~> 6.0;aws_route53_recordis unchanged and stable across both major versions.module "cnames"with all required variables (dummy values valid for plan + regex) and removes now-stale inline note aboutcnamespinning~> 5.0.[Fixed]entry under[Unreleased]accurately describing the constraint conflict and its resolution.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["terraform init (shared root)"] --> B{Resolve aws provider} B --> C["modules/cnames\nrequires aws ~> 6.0"] B --> D["modules/quilt\n(via vpc ~> 6.0)\nrequires aws >= 6.28"] C --> E["Intersection: aws >= 6.0, < 7.0"] D --> E E --> F["✅ Resolves (e.g. aws v6.49.0)"] subgraph "Before this PR" G["modules/cnames\nrequires aws ~> 5.0"] H["modules/quilt\nrequires aws >= 6.28"] G --> I["❌ No overlap — init fails"] H --> I end subgraph "CI Regression Guard" J["smoke/main.tf\ncompose quilt + cnames"] --> K["terraform init\nexercises both constraints"] K --> L["Future pin conflict\nfails CI at init"] endReviews (4): Last reviewed commit: "Tighten cnames guard comment in smoke wr..." | Re-trigger Greptile