providercache

package
v0.82.4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package providercache provides initialization of the Terragrunt provider caching server for caching OpenTofu providers.

Index

Constants

View Source
const (

	// The status returned when making a request to the caching provider.
	// It is needed to prevent further loading of providers by terraform, and at the same time make sure that the request was processed successfully.
	CacheProviderHTTPStatusCode = http.StatusLocked

	// Authentication type on the Terragrunt Provider Cache server.
	APIKeyAuth = "x-api-key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProviderCache

type ProviderCache struct {
	*cache.Server
	// contains filtered or unexported fields
}

func InitServer

func InitServer(l log.Logger, opts *options.TerragruntOptions) (*ProviderCache, error)

func (*ProviderCache) TerraformCommandHook

func (cache *ProviderCache) TerraformCommandHook(
	ctx context.Context,
	l log.Logger,
	opts *options.TerragruntOptions,
	args cli.Args,
) (*util.CmdOutput, error)

TerraformCommandHook warms up the providers cache, creates `.terraform.lock.hcl` and runs the `tofu/terraform init` command with using this cache. Used as a hook function that is called after running the target tofu/terraform command. For example, if the target command is `tofu plan`, it will be intercepted before it is run in the `/shell` package, then control will be passed to this function to init the working directory using cached providers.

Jump to

Keyboard shortcuts

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