Skip to content

Commit 9f09b2e

Browse files
committed
chore: Removal of legacy --terragrunt- flags
1 parent 247304c commit 9f09b2e

File tree

6 files changed

+20
-39
lines changed

6 files changed

+20
-39
lines changed

cli/commands/aws-provider-patch/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
5858
Destination: &opts.AwsProviderPatchOverrides,
5959
Usage: "A key=value attribute to override in a provider block as part of the aws-provider-patch command. May be specified multiple times.",
6060
},
61-
flags.WithDeprecatedName(terragruntPrefix.FlagName("override-attr"), terragruntPrefixControl)),
61+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("override-attr"), terragruntPrefixControl)),
6262
}
6363
}
6464

cli/commands/hcl/validate/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ func NewFlags(opts *options.TerragruntOptions, prefix flags.Prefix) cli.Flags {
3131
Destination: &opts.HCLValidateStrict,
3232
Usage: "Enables strict mode. When used in combination with the `--inputs` flag, any inputs defined in Terragrunt that are _not_ used in OpenTofu/Terraform will trigger an error.",
3333
},
34-
flags.WithDeprecatedFlagName("strict-validate", terragruntPrefixControl), // `--strict-validate`
3534
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars(
3635
"strict-validate", // `TG_STRICT_VALIDATE`
3736
"hclvalidate-strict-validate", // `TG_HCLVALIDATE_STRICT_VALIDATE`

cli/commands/render/cli.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ func NewFlags(opts *Options, prefix flags.Prefix) cli.Flags {
8585
Destination: &opts.OutputPath,
8686
Usage: "The file name that terragrunt should use when rendering the terragrunt.hcl config (next to the unit configuration).",
8787
},
88-
flags.WithDeprecatedFlagName("json-out", terragruntPrefixControl), // `--json-out`
8988
flags.WithDeprecatedEnvVars(tgPrefix.EnvVars("render-json-out"), terragruntPrefixControl), // `TG_RENDER_JSON_OUT`
9089
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("json-out"), terragruntPrefixControl), // `TERRAGRUNT_JSON_OUT`
9190
),

cli/commands/run/flags.go

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package run
44
import (
55
"fmt"
66
"path/filepath"
7-
"strconv"
87

98
"github.com/gruntwork-io/terragrunt/cli/flags"
109
"github.com/gruntwork-io/terragrunt/internal/cli"
@@ -135,7 +134,7 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
135134
Destination: &opts.GraphRoot,
136135
Usage: "Root directory from where to build graph dependencies.",
137136
},
138-
flags.WithDeprecatedName(terragruntPrefix.FlagName("graph-root"), terragruntPrefixControl)),
137+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("graph-root"), terragruntPrefixControl)),
139138

140139
// `--all` and `--graph` related flags.
141140

@@ -203,9 +202,11 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
203202
EnvVars: tgPrefix.EnvVars(DownloadDirFlagName),
204203
Destination: &opts.DownloadDir,
205204
Usage: "The path to download OpenTofu/Terraform modules into. Default is .terragrunt-cache in the working directory.",
206-
}, flags.WithDeprecatedNamesEnvVars(
207-
terragruntPrefix.FlagNames("download-dir"),
208-
terragruntPrefix.EnvVars("download"),
205+
}, flags.WithDeprecatedEnvVars(
206+
append(
207+
terragruntPrefix.EnvVars("download"),
208+
terragruntPrefix.EnvVars("download-dir")...,
209+
),
209210
terragruntPrefixControl)),
210211

211212
flags.NewFlag(&cli.GenericFlag[string]{
@@ -265,10 +266,14 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
265266
Destination: &opts.IAMRoleOptions.WebIdentityToken,
266267
Usage: "For AssumeRoleWithWebIdentity, the WebIdentity token.",
267268
},
268-
flags.WithDeprecatedNamesEnvVars(
269-
terragruntPrefix.FlagNames("iam-web-identity-token"),
270-
terragruntPrefix.EnvVars("iam-assume-role-web-identity-token"),
271-
terragruntPrefixControl)),
269+
flags.WithDeprecatedEnvVars(
270+
append(
271+
terragruntPrefix.EnvVars("iam-web-identity-token"),
272+
terragruntPrefix.EnvVars("iam-assume-role-web-identity-token")...,
273+
),
274+
terragruntPrefixControl,
275+
),
276+
),
272277

273278
flags.NewFlag(&cli.BoolFlag{
274279
Name: QueueIgnoreErrorsFlagName,
@@ -372,16 +377,7 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
372377
Usage: "If specified, the output of OpenTofu/Terraform commands will be printed as is, without being integrated into the Terragrunt log.",
373378
},
374379
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("forward-tf-stdout"), terragruntPrefixControl),
375-
flags.WithDeprecatedFlag(&cli.BoolFlag{
376-
Name: terragruntPrefix.FlagName("include-module-prefix"),
377-
EnvVars: terragruntPrefix.EnvVars("include-module-prefix"),
378-
Usage: "When this flag is set output from Terraform sub-commands is prefixed with module path.",
379-
Action: func(_ *cli.Context, _ bool) error {
380-
l.Warnf("The --include-module-prefix flag is deprecated. Use the functionality-inverted --%s flag instead. By default, Terraform/OpenTofu output is integrated into the Terragrunt log, which prepends additional data, such as timestamps and prefixes, to log entries.", TFForwardStdoutFlagName)
381-
382-
return nil
383-
},
384-
}, flags.NewValue(strconv.FormatBool(false)), legacyLogsControl)),
380+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars("include-module-prefix"), legacyLogsControl)),
385381

386382
flags.NewFlag(&cli.BoolFlag{
387383
Name: QueueStrictIncludeFlagName,

cli/flags/global/flags.go

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,23 +200,9 @@ func NewFlags(l log.Logger, opts *options.TerragruntOptions, prefix flags.Prefix
200200
},
201201
},
202202
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars(DeprecatedLogFormatFlagName), terragruntPrefixControl),
203-
flags.WithDeprecatedFlag(&cli.BoolFlag{
204-
Name: terragruntPrefix.FlagName(DeprecatedDisableLogFormattingFlagName),
205-
EnvVars: terragruntPrefix.EnvVars(DeprecatedDisableLogFormattingFlagName),
206-
Destination: &opts.DisableLogFormatting,
207-
Usage: "If specified, logs will be displayed in key/value format. By default, logs are formatted in a human readable format.",
208-
}, flags.NewValue(format.KeyValueFormatName), legacyLogsControl),
209-
flags.WithDeprecatedFlag(&cli.BoolFlag{
210-
Name: terragruntPrefix.FlagName(DeprecatedJSONLogFlagName),
211-
EnvVars: terragruntPrefix.EnvVars(DeprecatedJSONLogFlagName),
212-
Destination: &opts.JSONLogFormat,
213-
Usage: "If specified, Terragrunt will output its logs in JSON format.",
214-
}, flags.NewValue(format.JSONFormatName), legacyLogsControl),
215-
flags.WithDeprecatedFlag(&cli.BoolFlag{
216-
Name: terragruntPrefix.FlagName(DeprecatedTfLogJSONFlagName),
217-
EnvVars: terragruntPrefix.EnvVars(DeprecatedTfLogJSONFlagName),
218-
Usage: "If specified, Terragrunt will wrap Terraform stdout and stderr in JSON.",
219-
}, flags.NewValue(format.JSONFormatName), legacyLogsControl)),
203+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars(DeprecatedDisableLogFormattingFlagName), legacyLogsControl),
204+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars(DeprecatedJSONLogFlagName), legacyLogsControl),
205+
flags.WithDeprecatedEnvVars(terragruntPrefix.EnvVars(DeprecatedTfLogJSONFlagName), legacyLogsControl)),
220206

221207
flags.NewFlag(&cli.GenericFlag[string]{
222208
Name: LogCustomFormatFlagName,

internal/strict/controls/controls.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func New() strict.Controls {
163163
Name: TerragruntPrefixFlags,
164164
Description: "Prevents deprecated flags with `terragrunt-` prefixes from being used.",
165165
Category: stageCategory,
166+
Status: strict.CompletedStatus,
166167
},
167168
&Control{
168169
Name: TerragruntPrefixEnvVars,

0 commit comments

Comments
 (0)