diff --git a/internal/exec/help.go b/internal/exec/help.go index 60267c509..df79ec5ee 100644 --- a/internal/exec/help.go +++ b/internal/exec/help.go @@ -5,7 +5,6 @@ import ( "github.com/cloudposse/atmos/pkg/schema" u "github.com/cloudposse/atmos/pkg/utils" - "github.com/cloudposse/atmos/pkg/version" ) // processHelp processes help commands @@ -21,41 +20,57 @@ func processHelp( u.PrintMessage(fmt.Sprintf("atmos %s --stack [options]", componentType)) if componentType == "terraform" { - u.PrintMessage("\nAdditions and differences from native terraform:") - u.PrintMessage(" - before executing other 'terraform' commands, 'atmos' runs 'terraform init'") - u.PrintMessage(" - you can skip over atmos calling 'terraform init' if you know your project is already in a good working state by using " + - "the '--skip-init' flag like so 'atmos terraform -s --skip-init") - u.PrintMessage(" - 'atmos terraform deploy' command executes 'terraform apply -auto-approve' (sets the '-auto-approve' flag when running 'terraform apply')") - u.PrintMessage(" - 'atmos terraform deploy' command supports '--deploy-run-init=true/false' flag to enable/disable running 'terraform init' " + - "before executing the command") - u.PrintMessage(" - 'atmos terraform apply' and 'atmos terraform deploy' commands support '--from-plan' flag. If the flag is specified, " + - "the commands will use the planfile previously generated by 'atmos terraform plan' command instead of generating a new planfile") - u.PrintMessage(" - 'atmos terraform apply' and 'atmos terraform deploy' commands commands support '--planfile' flag to specify the path " + - "to a planfile. The '--planfile' flag should be used instead of the planfile argument in the native 'terraform apply ' command") - u.PrintMessage(" - 'atmos terraform clean' command deletes the '.terraform' folder, '.terraform.lock.hcl' lock file, " + - "and the previously generated 'planfile', 'varfile', and 'backend.tf.json' file for the specified component and stack. " + - "Use the --everything flag to also delete the Terraform state files and directories for the component. " + - "Note: State files store the local state of your infrastructure and should be handled with care, if not using a remote backend.\n\n" + - "Additional flags:\n" + - " --force Forcefully delete Terraform state files and directories without interaction\n" + - " --skip-lock-file Skip deleting the '.terraform.lock.hcl' file\n\n" + - "If no component or stack is specified, the clean operation will apply globally to all components.") - u.PrintMessage(" - 'atmos terraform workspace' command first runs 'terraform init -reconfigure', then 'terraform workspace select', " + - "and if the workspace was not created before, it then runs 'terraform workspace new'") - u.PrintMessage(" - 'atmos terraform import' command searches for 'region' in the variables for the specified component and stack, " + - "and if it finds it, sets 'AWS_REGION=' ENV var before executing the command") - u.PrintMessage(" - 'atmos terraform generate backend' command generates a backend config file for an 'atmos' component in a stack") - u.PrintMessage(" - 'atmos terraform generate backends' command generates backend config files for all 'atmos' components in all stacks") - u.PrintMessage(" - 'atmos terraform generate varfile' command generates a varfile for an 'atmos' component in a stack") - u.PrintMessage(" - 'atmos terraform generate varfiles' command generates varfiles for all 'atmos' components in all stacks") - u.PrintMessage(" - 'atmos terraform shell' command configures an environment for an 'atmos' component in a stack and starts a new shell " + - "allowing executing all native terraform commands inside the shell without using atmos-specific arguments and flags") - u.PrintMessage(" - double-dash '--' can be used to signify the end of the options for Atmos and the start of the additional " + - "native arguments and flags for the 'terraform' commands. " + - "For example: atmos terraform plan -s -- -refresh=false -lock=false") - u.PrintMessage(fmt.Sprintf(" - '--append-user-agent' flag sets the TF_APPEND_USER_AGENT environment variable to customize the User-Agent string in Terraform provider requests. "+ - "Example: 'Atmos/%s (Cloud Posse; +https://atmos.tools)'. "+ - "If not specified, defaults to 'atmos %s'\n", version.Version, version.Version)) + u.PrintMessage(` +Usage: atmos terraform [global options] [args] + +The available commands for execution are listed below. +The primary workflow commands are given first, followed by +less common or more advanced commands. + +Atmos commands: + generate backend Command generates a backend config file for an 'atmos' component in a stack + generate backends Command generates backend config files for all 'atmos' components in all stacks + generate varfile Command generates a varfile for an 'atmos' component in a stack + generate varfiles Command generates varfiles for all 'atmos' components in all stacks + shell Command configures an environment for an 'atmos' component in a stack and starts a new shell allowing executing all native terraform commands inside the shell without using atmos-specific arguments and flags + double-dash '--' Can be used to signify the end of the options for Atmos and the start of the additional native arguments and flags for the 'terraform' commands. For example: atmos terraform plan -s -- -refresh=false -lock=false + '--append-user-agent' Flag sets the TF_APPEND_USER_AGENT environment variable to customize the User-Agent string in Terraform provider requests. Example: 'Atmos/0.0.1 (Cloud Posse; +https://atmos.tools)'. If not specified, defaults to 'atmos 0.0.1' + +Main commands: + init Prepare your working directory for other commands + validate Check whether the configuration is valid + plan Show changes required by the current configuration + apply Create or update infrastructure + destroy Destroy previously-created infrastructure + +All other commands: + console Try Terraform expressions at an interactive command prompt + fmt Reformat your configuration in the standard style + force-unlock Release a stuck lock on the current workspace + get Install or upgrade remote Terraform modules + graph Generate a Graphviz graph of the steps in an operation + import Associate existing infrastructure with a Terraform resource + login Obtain and save credentials for a remote host + logout Remove locally-stored credentials for a remote host + metadata Metadata related commands + modules Show all declared modules in a working directory + output Show output values from your root module + providers Show the providers required for this configuration + refresh Update the state to match remote systems + show Show the current state or a saved plan + state Advanced state management + taint Mark a resource instance as not fully functional + test Execute integration tests for Terraform modules + untaint Remove the 'tainted' state from a resource instance + version Show the current Terraform version + workspace Workspace management + +Global options (use these before the subcommand, if any): + -chdir=DIR Switch to a different working directory before executing the + given subcommand. + -help Show this help output, or the help for a specified subcommand. + -version An alias for the "version" subcommand. +`) } if componentType == "helmfile" {