Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libs/digger_config/terragrunt/tac/base_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package tac

import (
"fmt"
"log/slog"
"strings"

"github.com/gruntwork-io/go-commons/errors"
"github.com/gruntwork-io/terragrunt/config"
"github.com/gruntwork-io/terragrunt/options"
Expand All @@ -11,8 +14,6 @@ import (
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/gocty"
"log/slog"
"strings"
)

const (
Expand Down Expand Up @@ -184,6 +185,7 @@ func attemptEvaluateLocals(
}

evalCtx.Functions[config.FuncNameSopsDecryptFile] = wrapStringSliceToStringAsFuncImpl(NoopSopsDecryptFile, contextExtensions.TrackInclude, terragruntOptions)
evalCtx.Functions[config.FuncNameGetEnv] = wrapStringSliceToStringAsFuncImpl(NoopGetEnv, contextExtensions.TrackInclude, terragruntOptions)

// Track the locals that were evaluated for logging purposes
newlyEvaluatedLocalNames := []string{}
Expand Down
2 changes: 2 additions & 0 deletions libs/digger_config/terragrunt/tac/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ func CreateTerragruntEvalContext(extensions config.EvalContextExtensions, filena

// override sops_decrypt_file function
ctx.Functions[config.FuncNameSopsDecryptFile] = wrapStringSliceToStringAsFuncImpl(NoopSopsDecryptFile, extensions.TrackInclude, terragruntOptions)
ctx.Functions[config.FuncNameSopsDecryptFile] = wrapStringSliceToStringAsFuncImpl(NoopGetEnv, extensions.TrackInclude, terragruntOptions)

return ctx, nil
}
5 changes: 5 additions & 0 deletions libs/digger_config/terragrunt/tac/sops_custom_fn.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ func NoopSopsDecryptFile(params []string, trackInclude *config.TrackInclude, ter
terragruntOptions.Logger.Debugf("SOPS decryption function has been replaced with a no-op version. This is to ensure that generation of projects is successful.")
return "{}", nil
}

func NoopGetEnv(params []string, trackInclude *config.TrackInclude, terragruntOptions *options.TerragruntOptions) (string, error) {
terragruntOptions.Logger.Debugf("get_env function has been replaced with a no-op version. This is to ensure that generation of projects is successful.")
return "", nil
}
Loading