package
0.48.2
Repository: https://github.com/gruntwork-io/terratest.git
Documentation: pkg.go.dev

# Functions

Apply runs terraform apply with the given options and return stdout/stderr.
ApplyAndIdempotent runs terraform apply with the given options and return stdout/stderr from the apply command.
ApplyAndIdempotentE runs terraform apply with the given options and return stdout/stderr from the apply command.
ApplyE runs terraform apply with the given options and return stdout/stderr.
AssertPlannedValuesMapKeyExists checks if the given key exists in the map, failing the test if it does not.
AssertResourceChangesMapKeyExists checks if the given key exists in the map, failing the test if it does not.
AssertTgPlanAllExitCode asserts the succuess (or failure) of a terragrunt run-all plan.
Destroy runs terraform destroy with the given options and return stdout/stderr.
DestroyE runs terraform destroy with the given options and return stdout/stderr.
FormatArgs converts the inputs to a format palatable to terraform.
FormatTerraformArgs will format multiple args with the arg name (e.g.
FormatTerraformBackendConfigAsArgs formats the given variables as backend config args for Terraform (e.g.
FormatTerraformLockAsArgs formats the lock and lock-timeout variables -lock, -lock-timeout.
FormatTerraformPlanFileAsArg formats the out variable as a command-line arg for Terraform (e.g.
FormatTerraformPluginDirAsArgs formats the plugin-dir variable -plugin-dir.
FormatTerraformVarsAsArgs formats the given variables as command-line args for Terraform (e.g.
Get calls terraform get and return stdout/stderr.
GetAllVariablesFromVarFile Parses all data from a provided input file found ind in VarFile and stores the result in the value pointed to by out.
GetAllVariablesFromVarFileE Parses all data from a provided input file found ind in VarFile and stores the result in the value pointed to by out.
GetCommonOptions extracts commons terraform options.
GetE calls terraform get and return stdout/stderr.
GetExitCodeForTerraformCommand runs terraform with the given arguments and options and returns exit code.
GetExitCodeForTerraformCommandE runs terraform with the given arguments and options and returns exit code.
GetResourceCount parses stdout/stderr of apply/plan/destroy commands and returns number of affected resources.
GetResourceCountE parses stdout/stderr of apply/plan/destroy commands and returns number of affected resources.
GetVariableAsListFromVarFile Gets the string list representation of a variable from a provided input file found in VarFile Note that this returns a list of strings.
GetVariableAsListFromVarFileE Gets the string list representation of a variable from a provided input file found in VarFile Note that this returns a list of strings.
GetVariableAsMapFromVarFile Gets the map representation of a variable from a provided input file found in VarFile Note that this returns a map of strings.
GetVariableAsMapFromVarFileE Gets the map representation of a variable from a provided input file found in VarFile.
GetVariableAsStringFromVarFile Gets the string representation of a variable from a provided input file found in VarFile For list or map, use GetVariableAsListFromVarFile or GetVariableAsMapFromVarFile, respectively.
GetVariableAsStringFromVarFileE Gets the string representation of a variable from a provided input file found in VarFile Will return an error if GetAllVariablesFromVarFileE returns an error or the key provided does not exist in the file.
HCLFileToJSONFile is a function that takes a path containing HCL code, and converts it to JSON representation and writes out the contents to the given path.
Init calls terraform init and return stdout/stderr.
InitAndApply runs terraform init and apply with the given options and return stdout/stderr from the apply command.
InitAndApplyAndIdempotent runs terraform init and apply with the given options and return stdout/stderr from the apply command.
InitAndApplyAndIdempotentE runs terraform init and apply with the given options and return stdout/stderr from the apply command.
InitAndApplyE runs terraform init and apply with the given options and return stdout/stderr from the apply command.
InitAndPlan runs terraform init and plan with the given options and returns stdout/stderr from the plan command.
InitAndPlanAndShow runs terraform init, then terraform plan, and then terraform show with the given options, and returns the json output of the plan file.
InitAndPlanAndShowE runs terraform init, then terraform plan, and then terraform show with the given options, and returns the json output of the plan file.
InitAndPlanAndShowWithStruct runs terraform init, then terraform plan, and then terraform show with the given options, and parses the json result into a go struct.
InitAndPlanAndShowWithStructE runs terraform init, then terraform plan, and then terraform show with the given options, and parses the json result into a go struct.
InitAndPlanAndShowWithStructNoLog runs InitAndPlanAndShowWithStruct without logging and also by allocating a temporary plan file destination that is discarded before returning the struct.
InitAndPlanE runs terraform init and plan with the given options and returns stdout/stderr from the plan command.
InitAndPlanWithExitCode runs terraform init and plan with the given options and returns exitcode for the plan command.
InitAndPlanWithExitCodeE runs terraform init and plan with the given options and returns exitcode for the plan command.
InitAndValidate runs terraform init and validate with the given options and returns stdout/stderr from the validate command.
InitAndValidateE runs terraform init and validate with the given options and returns stdout/stderr from the validate command.
InitAndValidateInputs runs terragrunt init and validate-inputs with the given options and returns stdout/stderr from the validate command.
InitAndValidateInputsE runs terragrunt init and validate with the given options and rerutns stdout/stderr.
InitE calls terraform init and return stdout/stderr.
OPAEval runs `opa eval` with the given option on the terraform files identified in the TerraformDir directory of the Options struct.
OPAEvalE runs `opa eval` with the given option on the terraform files identified in the TerraformDir directory of the Options struct.
Output calls terraform output for the given variable and return its string value representation.
OutputAll calls terraform output returns all values as a map.
OutputAllE calls terraform and returns all the outputs as a map.
OutputE calls terraform output for the given variable and return its string value representation.
OutputForKeys calls terraform output for the given key list and returns values as a map.
OutputForKeysE calls terraform output for the given key list and returns values as a map.
OutputJson calls terraform output for the given variable and returns the result as the json string.
OutputJsonE calls terraform output for the given variable and returns the result as the json string.
OutputList calls terraform output for the given variable and returns its value as a list.
OutputListE calls terraform output for the given variable and returns its value as a list.
OutputListOfObjects calls terraform output for the given variable and returns its value as a list of maps/lists.
OutputListOfObjectsE calls terraform output for the given variable and returns its value as a list of maps/lists.
OutputMap calls terraform output for the given variable and returns its value as a map.
OutputMapE calls terraform output for the given variable and returns its value as a map.
OutputMapOfObjects calls terraform output for the given variable and returns its value as a map of lists/maps.
OutputMapOfObjectsE calls terraform output for the given variable and returns its value as a map of lists/maps.
OutputRequired calls terraform output for the given variable and return its value.
OutputRequiredE calls terraform output for the given variable and return its value.
OutputStruct calls terraform output for the given variable and stores the result in the value pointed to by v.
OutputStructE calls terraform output for the given variable and stores the result in the value pointed to by v.
ParsePlanJSON takes in the json string representation of the terraform plan and returns a go struct representation for easy introspection.
Plan runs terraform plan with the given options and returns stdout/stderr.
PlanE runs terraform plan with the given options and returns stdout/stderr.
PlanExitCode runs terraform plan with the given options and returns the detailed exitcode.
PlanExitCodeE runs terraform plan with the given options and returns the detailed exitcode.
RequirePlannedValuesMapKeyExists checks if the given key exists in the map, failing and halting the test if it does not.
RequireResourceChangesMapKeyExists checks if the given key exists in the map, failing the test if it does not.
RunTerraformCommand runs terraform with the given arguments and options and return stdout/stderr.
RunTerraformCommandAndGetStdoutE runs terraform with the given arguments and options and returns solely its stdout (but not stderr).
RunTerraformCommandE runs terraform with the given arguments and options and return stdout/stderr.
Show calls terraform show in json mode with the given options and returns stdout from the command.
ShowE calls terraform show in json mode with the given options and returns stdout from the command.
TgApplyAll runs terragrunt apply with the given options and return stdout/stderr.
TgApplyAllE runs terragrunt apply-all with the given options and return stdout/stderr.
TgDestroyAll runs terragrunt destroy with the given options and return stdout.
TgDestroyAllE runs terragrunt destroy with the given options and return stdout.
TgPlanAllExitCode runs terragrunt plan-all with the given options and returns the detailed exitcode.
TgPlanAllExitCodeE runs terragrunt plan-all with the given options and returns the detailed exitcode.
Validate calls terraform validate and returns stdout/stderr.
ValidateE calls terraform validate and returns stdout/stderr.
ValidateInputs calls terragrunt validate and returns stdout/stderr.
ValidateInputsE calls terragrunt validate-inputs and returns stdout/stderr.
WithDefaultRetryableErrors makes a copy of the Options object and returns an updated object with sensible defaults for retryable errors.
WorkspaceDelete removes the specified terraform workspace with the given options.
WorkspaceDelete removes the specified terraform workspace with the given options.
WorkspaceSelectOrNew runs terraform workspace with the given options and the workspace name and returns a name of the current workspace.
WorkspaceSelectOrNewE runs terraform workspace with the given options and the workspace name and returns a name of the current workspace.

# Constants

DefaultErrorExitCode is the exit code returned when terraform command fails.
DefaultSuccessExitCode is the exit code returned when terraform command succeeds.
TerraformDefaultPath to run terraform.
TerraformPlanChangesPresentExitCode is the exit code returned by terraform plan detailed exitcode when changes are present.
TerragruntDefaultPath to run terragrunt.
TofuDefaultPath command to run tofu.

# Variables

TerraformCommandsWithLockSupport is a list of all the Terraform commands that can obtain locks on Terraform state.
TerraformCommandsWithPlanFileSupport is a list of all the Terraform commands that support interacting with plan files.

# Structs

When you convert a cty value to JSON, if any of that types are not yet known (i.e., are labeled as DynamicPseudoType), cty's Marshall method will write the type information to a type field and the actual value to a value field.
InputFileKeyNotFound occurs when tfvar file does not contain a value for the key specified in the function call.
Options for running Terraform commands.
OutputValueNotList occurs when casting a found output value to a list of interfaces fails.
OutputValueNotMap occures when casting a found output value to a map fails.
PanicWhileParsingVarFile is returned when the HCL parsing routine panics due to errors.
PlanStruct is a Go Struct representation of the plan object returned from Terraform (after running `terraform show`).
ResourceCount represents counts of resources affected by terraform apply/plan/destroy command.
UnexpectedOutputType is an error that occurs when the output is not of the type we expect.
UnsupportedDefaultWorkspaceDeletion is returned when user tries to delete the workspace "default".
VarFileNotFound is an error that occurs when a var file cannot be found in an option's VarFile list.

# Type aliases

EmptyOutput is an error that occurs when an output is empty.
OutputKeyNotFound occurs when terraform output does not contain a value for the key specified in the function call.
TgInvalidBinary occurs when a terragrunt function is called and the TerraformBinary is set to a value other than terragrunt.
WorkspaceDoesNotExist is returned when user tries to delete a workspace which does not exist.