Skip to content

Add hosted Terraform module manifest and discovery contract#254

Draft
whitemerch wants to merge 6 commits into
mainfrom
chakib.hamie/hosted_module_contract
Draft

Add hosted Terraform module manifest and discovery contract#254
whitemerch wants to merge 6 commits into
mainfrom
chakib.hamie/hosted_module_contract

Conversation

@whitemerch

Copy link
Copy Markdown
Contributor

Motivation

Hosted IaC scanning needs a stable scanner-side contract for discovering Terraform module calls and consuming server-prefetched module directories without enabling network fetches inside the scanner subprocess.

Changes

CLI

Add list-modules so hosted services can enumerate Terraform module calls as JSON before server-side materialization.

Manifest scanning

Allow manifest-only module resolution via --x-remote-modules-manifest, enable local module evaluation when a manifest or .terraform/modules cache is present, and validate manifest version constraints against resolved module versions.

Stability

Strip registry module version segments from Terraform fingerprints so upgrading a remote module does not churn finding identity.

QA Instruction

  1. go test ./cmd/scanner ./pkg/parser/terraform/modules/modulegraph ./pkg/parser/terraform/modules/resolver ./pkg/scan ./pkg/model
  2. golangci-lint run -c .golangci.yml --timeout 20m
  3. ./bin/datadog-iac-scanner list-modules -p <terraform-root>
  4. ./bin/datadog-iac-scanner scan -p <terraform-root> --x-remote-modules-manifest <modules.json>

Impact

Adds the hosted module discovery and manifest contract on top of the bounded module graph work in #253.

@whitemerch
whitemerch requested a review from a team as a code owner July 13, 2026 12:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ba317d033

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkg/scan/remote_modules.go Outdated
Comment thread pkg/scan/remote_modules.go Outdated
@whitemerch
whitemerch marked this pull request as draft July 13, 2026 13:24
@whitemerch
whitemerch changed the base branch from main to chakib.hamie/remote_module_bounded_walker July 13, 2026 13:24
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 13, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 70.31%
Overall Coverage: 50.85% (+0.72%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 907f3c1 | Docs | Datadog PR Page | Give us feedback!

@whitemerch
whitemerch force-pushed the chakib.hamie/hosted_module_contract branch from 29ffe4a to fa7feb3 Compare July 13, 2026 15:22
Base automatically changed from chakib.hamie/remote_module_bounded_walker to main July 15, 2026 09:26
return -1
}
return result
return int(line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants