cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 51 Imported by: 0

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

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

func ExitErrHandler

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

ExitErrHandler is an empty function that overrides the default behavior.

func NewDeprecatedFlags

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

NewDeprecatedFlags creates and returns deprecated flags.

func OSExiter

func OSExiter(exitCode int)

OSExiter is an empty function that overrides the default behavior.

func TerragruntCommands

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

TerragruntCommands returns the set of Terragrunt commands.

func WrapWithTelemetry

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

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

func NewApp

func NewApp(opts *options.TerragruntOptions) *App

NewApp creates the Terragrunt CLI App.

func (*App) Run

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

func (*App) RunContext

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

type ProviderCache

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

func InitProviderCacheServer

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

func (*ProviderCache) TerraformCommandHook

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