resolver

package
v1.7.1-delta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

  • Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. *

  • This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.

Package resolver implements Terraform module resolution for tfmodules.RemoteResolver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitModuleResolveKey added in v1.8.0

func GitModuleResolveKey(source, version string) (string, bool)

GitModuleResolveKey returns a canonical cache key for pinned git module sources. Identical content folds transport spellings (https vs ssh, .git suffix) into one key. Returns false when the source is not a git:: module with ref= (not BareGit-owned).

func NewModuleCache

func NewModuleCache() (*moduleCache, error)

NewModuleCache creates ~/.cache/.../modules (or XDG_CACHE_HOME) and returns it.

Types

type BareGitResolver added in v1.8.0

type BareGitResolver struct {
	// Defaults to <user-cache-dir>/datadog-iac-scanner/git-bare.
	CacheDir string
	// contains filtered or unexported fields
}

BareGitResolver keeps one bare clone per repo and extracts refs via git archive.

func NewBareGitResolver added in v1.8.0

func NewBareGitResolver(cacheDir string) *BareGitResolver

func (*BareGitResolver) Resolve added in v1.8.0

Resolve implements Resolver for any git:: source that carries a ref= parameter.

type ChainResolver

type ChainResolver struct {
	// contains filtered or unexported fields
}

ChainResolver tries each Resolver in order.

func NewChainResolver

func NewChainResolver(resolvers ...Resolver) *ChainResolver

func (*ChainResolver) Resolve

type DotTerraformResolver

type DotTerraformResolver struct {
	RootDirs []string
	// contains filtered or unexported fields
}

DotTerraformResolver reads terraform init output: .terraform/modules/modules.json.

func (*DotTerraformResolver) Resolve

type LocalGitRefResolver added in v1.8.0

type LocalGitRefResolver struct {
	ScanRoots []string

	// Defaults to <user-cache-dir>/datadog-iac-scanner/git-local.
	CacheDir string
	// contains filtered or unexported fields
}

LocalGitRefResolver extracts self-referential git modules from the local checkout.

func NewLocalGitRefResolver added in v1.8.0

func NewLocalGitRefResolver(scanRoots []string, cacheDir string) *LocalGitRefResolver

func (*LocalGitRefResolver) Resolve added in v1.8.0

Resolve implements Resolver for git:: sources that reference the local checkout.

type LocalResolver

type LocalResolver struct{}

LocalResolver resolves local filesystem module sources.

func (LocalResolver) Resolve

type Manifest

type Manifest struct {
	Dir     string                   `json:"dir"`
	Modules map[string]ManifestEntry `json:"modules"`
}

Manifest is validated JSON: optional root Dir plus source or source@version → ManifestEntry.

func LoadManifest

func LoadManifest(path string) (*Manifest, error)

LoadManifest parses and validates manifest JSON from path.

type ManifestEntry

type ManifestEntry struct {
	LocalPath string `json:"local_path"`
	Version   string `json:"version,omitempty"`
	Origin    string `json:"origin,omitempty"`
}

ManifestEntry is one row in a --modules-manifest JSON file.

type PrefetchedResolver

type PrefetchedResolver struct {
	// contains filtered or unexported fields
}

PrefetchedResolver resolves modules from a --modules-manifest.

func NewPrefetchedResolver

func NewPrefetchedResolver(m *Manifest) *PrefetchedResolver

func (*PrefetchedResolver) Resolve

type Resolution

type Resolution struct {
	LocalPath string
	Cleanup   func() // optional post-scan cleanup
}

Resolution holds a resolved module directory and optional cleanup.

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, mod *tfmodules.ParsedModule) (Resolution, error)
}

Resolver maps one module call to disk; errors should wrap *tfmodules.UnresolvedError when appropriate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL