Documentation ¶
Index ¶
- Constants
- Variables
- func CheckTerraformVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
- func CreateTerragruntCli(version string, writer io.Writer, errwriter io.Writer) *cli.App
- func ParseTerragruntOptions(cliContext *cli.Context) (*options.TerragruntOptions, error)
- type ArgMissingValue
- type InvalidTerraformVersion
- type InvalidTerraformVersionSyntax
- type TerraformSource
- type UnrecognizedCommand
Constants ¶
const CMD_APPLY_ALL = "apply-all"
const CMD_DESTROY_ALL = "destroy-all"
const CMD_OUTPUT_ALL = "output-all"
const CMD_SPIN_UP = "spin-up"
CMD_SPIN_UP is deprecated.
const CMD_TEAR_DOWN = "tear-down"
CMD_TEAR_DOWN is deprecated.
const DEFAULT_TERRAFORM_VERSION_CONSTRAINT = ">= v0.9.3"
const OPT_NON_INTERACTIVE = "terragrunt-non-interactive"
const OPT_TERRAGRUNT_CONFIG = "terragrunt-config"
const OPT_TERRAGRUNT_SOURCE = "terragrunt-source"
const OPT_TERRAGRUNT_SOURCE_UPDATE = "terragrunt-source-update"
const OPT_TERRAGRUNT_TFPATH = "terragrunt-tfpath"
const OPT_WORKING_DIR = "terragrunt-working-dir"
const TERRAFORM_EXTENSION_GLOB = "*.tf"
Variables ¶
var ALL_TERRAGRUNT_BOOLEAN_OPTS = []string{OPT_NON_INTERACTIVE, OPT_TERRAGRUNT_SOURCE_UPDATE}
var ALL_TERRAGRUNT_STRING_OPTS = []string{OPT_TERRAGRUNT_CONFIG, OPT_TERRAGRUNT_TFPATH, OPT_WORKING_DIR, OPT_TERRAGRUNT_SOURCE}
var CUSTOM_USAGE_TEXT = `` /* 1244-byte string literal not displayed */
Since Terragrunt is just a thin wrapper for Terraform, and we don't want to repeat every single Terraform command in its definition, we don't quite fit into the model of any Go CLI library. Fortunately, urfave/cli allows us to override the whole template used for the Usage Text.
TODO: this description text has copy/pasted versions of many Terragrunt constants, such as command names and file names. It would be easy to make this code DRY using fmt.Sprintf(), but then it's hard to make the text align nicely. Write some code to take generate this help text automatically, possibly leveraging code that's part of urfave/cli.
var DEPRECATED_COMMANDS = map[string]string{ CMD_SPIN_UP: CMD_APPLY_ALL, CMD_TEAR_DOWN: CMD_DESTROY_ALL, }
DEPRECATED_COMMANDS is a map of deprecated commands to the commands that replace them.
var DontManuallyConfigureRemoteState = fmt.Errorf("Instead of manually using the 'remote config' command, define your remote state settings in %s and Terragrunt will automatically configure it for you (and all your team members) next time you run it.", config.DefaultTerragruntConfigPath)
var MODULE_REGEX = regexp.MustCompile(`module[[:blank:]]+".+"`)
var MULTI_MODULE_COMMANDS = []string{CMD_APPLY_ALL, CMD_DESTROY_ALL, CMD_OUTPUT_ALL}
var TERRAFORM_COMMANDS_THAT_USE_STATE = []string{
"apply",
"destroy",
"env",
"import",
"graph",
"output",
"plan",
"push",
"refresh",
"show",
"taint",
"untaint",
"validate",
"force-unlock",
"state",
}
var TERRAFORM_VERSION_REGEX = regexp.MustCompile("Terraform (.+)")
The terraform --version output is of the format: Terraform v0.9.3
Functions ¶
func CheckTerraformVersion ¶ added in v0.12.5
func CheckTerraformVersion(constraint string, terragruntOptions *options.TerragruntOptions) error
Check that the currently installed Terraform version works meets the specified version constraint and return an error if it doesn't
func CreateTerragruntCli ¶
Create the Terragrunt CLI App
func ParseTerragruntOptions ¶ added in v0.6.0
func ParseTerragruntOptions(cliContext *cli.Context) (*options.TerragruntOptions, error)
Parse command line options that are passed in for Terragrunt
Types ¶
type ArgMissingValue ¶ added in v0.6.0
type ArgMissingValue string
func (ArgMissingValue) Error ¶ added in v0.6.0
func (err ArgMissingValue) Error() string
type InvalidTerraformVersion ¶ added in v0.12.5
type InvalidTerraformVersion struct { CurrentVersion *version.Version VersionConstraints version.Constraints }
func (InvalidTerraformVersion) Error ¶ added in v0.12.5
func (err InvalidTerraformVersion) Error() string
type InvalidTerraformVersionSyntax ¶ added in v0.12.5
type InvalidTerraformVersionSyntax string
func (InvalidTerraformVersionSyntax) Error ¶ added in v0.12.5
func (err InvalidTerraformVersionSyntax) Error() string
type TerraformSource ¶ added in v0.9.7
type TerraformSource struct { // A canonical version of RawSource, in URL format CanonicalSourceURL *url.URL // The folder where we should download the source to DownloadDir string // The folder in DownloadDir that should be used as the working directory for Terraform WorkingDir string // The path to a file in DownloadDir that stores the version number of the code VersionFile string }
This struct represents information about Terraform source code that needs to be downloaded
func (*TerraformSource) String ¶ added in v0.9.7
func (src *TerraformSource) String() string
type UnrecognizedCommand ¶ added in v0.6.0
type UnrecognizedCommand string
func (UnrecognizedCommand) Error ¶ added in v0.6.0
func (commandName UnrecognizedCommand) Error() string