Skip to content

Commit be684fa

Browse files
committed
Correctly handles *string values when logging sweepers
1 parent a82b0e3 commit be684fa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

internal/sweep/framework/resource.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package framework
66
import (
77
"context"
88

9+
"github.com/aws/aws-sdk-go-v2/aws"
910
"github.com/hashicorp/terraform-plugin-framework/path"
1011
fwresource "github.com/hashicorp/terraform-plugin-framework/resource"
1112
rschema "github.com/hashicorp/terraform-plugin-framework/resource/schema"
@@ -72,7 +73,13 @@ func (sr *sweepResource) Delete(ctx context.Context, optFns ...tfresource.Option
7273
if d.HasError() {
7374
return fwdiag.DiagnosticsError(d)
7475
}
75-
ctx = tflog.SetField(ctx, attr.path, attr.value)
76+
switch v := attr.value.(type) {
77+
case *string:
78+
ctx = tflog.SetField(ctx, attr.path, aws.ToString(v))
79+
80+
default:
81+
ctx = tflog.SetField(ctx, attr.path, v)
82+
}
7683
}
7784

7885
tflog.Info(ctx, "Sweeping resource")

0 commit comments

Comments
 (0)