in cmd/terraformCmd.go [52:83]
func NewTerraformCommand() *cobra.Command {
terraformCmd := &cobra.Command{
Use: "terraform",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: getMPFTerraform,
}
terraformCmd.Flags().StringVarP(&flgTFPath, "tfPath", "", "", "Path to Terraform Executable")
err := terraformCmd.MarkFlagRequired("tfPath")
if err != nil {
log.Errorf("Error marking flag required for Terraform executable path: %v\n", err)
}
terraformCmd.Flags().StringVarP(&flgWorkingDir, "workingDir", "", "", "Path to Terraform Working Directory")
err = terraformCmd.MarkFlagRequired("workingDir")
if err != nil {
log.Errorf("Error marking flag required for Terraform working directory: %v\n", err)
}
terraformCmd.Flags().StringVarP(&flgVarFilePath, "varFilePath", "", "", "Path to Terraform Variable File")
terraformCmd.Flags().BoolVarP(&flgImportExistingResourcesToState, "importExistingResourcesToState", "", true, "On existing resource error, import existing resources into to Terraform State. This will also destroy the imported resources before MPF execution completes.")
terraformCmd.Flags().StringVarP(&flgTargetModule, "targetModule", "", "", "The Terraform module to Target Module to run MPF on")
return terraformCmd
}