cli

package
v0.70.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 50 Imported by: 18

Documentation

Overview

Package cli configures the Terragrunt CLI app and its commands.

Index

Constants

View Source
const (
	CommandNameSpinUp      = "spin-up"
	CommandNameTearDown    = "tear-down"
	CommandNamePlanAll     = "plan-all"
	CommandNameApplyAll    = "apply-all"
	CommandNameDestroyAll  = "destroy-all"
	CommandNameOutputAll   = "output-all"
	CommandNameValidateAll = "validate-all"
)

The following commands are DEPRECATED

View Source
const (
	TerragruntIncludeModulePrefixFlagName = "terragrunt-include-module-prefix"
	TerragruntIncludeModulePrefixEnvName  = "TERRAGRUNT_INCLUDE_MODULE_PREFIX"

	TerragruntDisableLogFormattingFlagName = "terragrunt-disable-log-formatting"
	TerragruntDisableLogFormattingEnvName  = "TERRAGRUNT_DISABLE_LOG_FORMATTING"

	TerragruntJSONLogFlagName = "terragrunt-json-log"
	TerragruntJSONLogEnvName  = "TERRAGRUNT_JSON_LOG"

	TerragruntTfLogJSONFlagName = "terragrunt-tf-logs-to-json"
	TerragruntTfLogJSONEnvName  = "TERRAGRUNT_TF_JSON_LOG"
)

The following flags are DEPRECATED

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"
)
View Source
const AppHelpTemplate = `` /* 832-byte string literal not displayed */
View Source
const AppVersionTemplate = `terragrunt version {{.App.Version}}
`
View Source
const CommandHelpTemplate = `` /* 975-byte string literal not displayed */

Variables

This section is empty.

Functions

func DeprecatedCommands added in v0.66.7

func DeprecatedCommands(opts *options.TerragruntOptions) cli.Commands

func ExitErrHandler added in v0.68.0

func ExitErrHandler(_ *cli.Context, err error) error

ExitErrHandler is an empty function that overrides the default behavior.

func NewDeprecatedFlags added in v0.67.0

func NewDeprecatedFlags(opts *options.TerragruntOptions) cli.Flags

NewDeprecatedFlags creates and returns deprecated flags.

func OSExiter added in v0.66.7

func OSExiter(exitCode int)

OSExiter is an empty function that overrides the default behavior.

func TerragruntCommands added in v0.66.7

func TerragruntCommands(opts *options.TerragruntOptions) cli.Commands

TerragruntCommands returns the set of Terragrunt commands.

func WrapWithTelemetry added in v0.66.7

func WrapWithTelemetry(opts *options.TerragruntOptions) func(ctx *cli.Context, action cli.ActionFunc) error

WrapWithTelemetry wraps CLI command execution with setting of telemetry context and labels, if telemetry is disabled, just runAction the command.

Types

type App added in v0.56.4

type App struct {
	*cli.App
	// contains filtered or unexported fields
}

func NewApp added in v0.48.7

func NewApp(opts *options.TerragruntOptions) *App

NewApp creates the Terragrunt CLI App.

func (*App) Run added in v0.56.4

func (app *App) Run(args []string) error

func (*App) RunContext added in v0.56.4

func (app *App) RunContext(ctx context.Context, args []string) error

type ProviderCache added in v0.57.9

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

func InitProviderCacheServer added in v0.56.4

func InitProviderCacheServer(opts *options.TerragruntOptions) (*ProviderCache, error)

func (*ProviderCache) TerraformCommandHook added in v0.57.9

func (cache *ProviderCache) TerraformCommandHook(
	ctx context.Context,
	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.

Directories

Path Synopsis
Package commands provides the implementation of the Terragrunt commands.
Package commands provides the implementation of the Terragrunt commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳