Skip to content

Commit 8503091

Browse files
committed
support additiona parsing arguments
1 parent 2dec859 commit 8503091

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

libs/digger_config/digger_config.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,19 @@ func HandleYamlProjectGeneration(config *DiggerConfigYaml, terraformDir string,
408408
workflow = b.Workflow
409409
}
410410

411-
tgParsingConfig := TerragruntParsingConfig{
412-
CreateProjectName: true,
413-
DefaultWorkflow: workflow,
414-
WorkflowFile: b.WorkflowFile,
415-
FilterPath: path.Join(terraformDir, *b.RootDir),
416-
AwsRoleToAssume: b.AwsRoleToAssume,
417-
AwsCognitoOidcConfig: b.AwsCognitoOidcConfig,
411+
// load the parsing config and override the block values
412+
tgParsingConfig := b.TerragruntParsingConfig
413+
if tgParsingConfig == nil {
414+
tgParsingConfig = &TerragruntParsingConfig{}
418415
}
419-
420-
err := hydrateDiggerConfigYamlWithTerragrunt(config, tgParsingConfig, terraformDir)
416+
tgParsingConfig.CreateProjectName = true
417+
tgParsingConfig.DefaultWorkflow = workflow
418+
tgParsingConfig.WorkflowFile = b.WorkflowFile
419+
tgParsingConfig.FilterPath = path.Join(terraformDir, *b.RootDir)
420+
tgParsingConfig.AwsRoleToAssume = b.AwsRoleToAssume
421+
tgParsingConfig.AwsCognitoOidcConfig = b.AwsCognitoOidcConfig
422+
423+
err := hydrateDiggerConfigYamlWithTerragrunt(config, *tgParsingConfig, terraformDir)
421424
if err != nil {
422425
slog.Error("failed to hydrate config with terragrunt",
423426
"error", err,

libs/digger_config/yaml.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ type BlockYaml struct {
108108
ExcludePatterns []string `yaml:"exclude_patterns,omitempty"`
109109

110110
// these flags are only for terragrunt
111-
Terragrunt bool `yaml:"terragrunt"`
112-
RootDir *string `yaml:"root_dir"`
111+
Terragrunt bool `yaml:"terragrunt"`
112+
RootDir *string `yaml:"root_dir"`
113+
TerragruntParsingConfig *TerragruntParsingConfig `yaml:"terragrunt_parsing,omitempty"`
113114

114115
// these flags are only for opentofu
115116
OpenTofu bool `yaml:"opentofu"`

0 commit comments

Comments
 (0)