diff --git a/.changelog/1059.txt b/.changelog/1059.txt new file mode 100644 index 0000000000..66a49f3a37 --- /dev/null +++ b/.changelog/1059.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +helper/resource: Added Terraform configuration to `TRACE` logging +``` diff --git a/internal/logging/keys.go b/internal/logging/keys.go index 86700506a9..ad51072184 100644 --- a/internal/logging/keys.go +++ b/internal/logging/keys.go @@ -31,6 +31,9 @@ const ( // The TestStep number of the test being executed. Starts at 1. KeyTestStepNumber = "test_step_number" + // Terraform configuration used during acceptance testing Terraform operations. + KeyTestTerraformConfiguration = "test_terraform_configuration" + // The Terraform CLI logging level (TF_LOG) used for an acceptance test. KeyTestTerraformLogLevel = "test_terraform_log_level" diff --git a/internal/plugintest/working_dir.go b/internal/plugintest/working_dir.go index f9f0e5923d..123a7ed119 100644 --- a/internal/plugintest/working_dir.go +++ b/internal/plugintest/working_dir.go @@ -76,6 +76,8 @@ func (wd *WorkingDir) GetHelper() *Helper { // Destroy to establish the configuration. Any previously-set configuration is // discarded and any saved plan is cleared. func (wd *WorkingDir) SetConfig(ctx context.Context, cfg string) error { + logging.HelperResourceTrace(ctx, "Setting Terraform configuration", map[string]any{logging.KeyTestTerraformConfiguration: cfg}) + outFilename := filepath.Join(wd.baseDir, ConfigFileName) rmFilename := filepath.Join(wd.baseDir, ConfigFileNameJSON) bCfg := []byte(cfg)