Skip to content

Commit 741fee1

Browse files
committed
impr: don't store file content in state
1 parent 36a3758 commit 741fee1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

provider/file_resource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ func (r *fileResource) Schema(ctx context.Context, req resource.SchemaRequest, r
9494
Sensitive: true, // define as sensitive, because content could be + avoid printing it
9595
PlanModifiers: []planmodifier.String{
9696
stringplanmodifier.RequiresReplace(),
97+
stringplanmodifier.UseStateForUnknown(),
9798
},
9899
},
99100
},
@@ -162,6 +163,9 @@ func (r *fileResource) Create(ctx context.Context, req resource.CreateRequest, r
162163
data.SHA1Sum = types.StringValue(res[0].SHA1sum)
163164
data.Location = types.StringValue(res[0].Location)
164165

166+
// Nullify content so it doesn’t go into state
167+
data.ContentB64 = types.StringUnknown()
168+
165169
if resp.Diagnostics.HasError() {
166170
return
167171
}

0 commit comments

Comments
 (0)