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.
Package resolver implements Terraform module resolution for tfmodules.RemoteResolver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModuleCache ¶
func NewModuleCache() (*moduleCache, error)
NewModuleCache creates ~/.cache/.../modules (or XDG_CACHE_HOME) and returns it.
Types ¶
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 ¶
func (c *ChainResolver) Resolve(ctx context.Context, mod *tfmodules.ParsedModule) (Resolution, error)
type DotTerraformResolver ¶
type DotTerraformResolver struct {
RootDirs []string
// contains filtered or unexported fields
}
DotTerraformResolver reads terraform init output: .terraform/modules/modules.json.
func (*DotTerraformResolver) Resolve ¶
func (r *DotTerraformResolver) Resolve(_ context.Context, mod *tfmodules.ParsedModule) (Resolution, error)
type LocalResolver ¶
type LocalResolver struct{}
LocalResolver resolves local filesystem module sources.
func (LocalResolver) Resolve ¶
func (LocalResolver) Resolve(_ context.Context, mod *tfmodules.ParsedModule) (Resolution, error)
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 ¶
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 ¶
func (r *PrefetchedResolver) Resolve(_ context.Context, mod *tfmodules.ParsedModule) (Resolution, error)
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.