diff --git a/internal/provider/filter_resource.go b/internal/provider/filter_resource.go index c7b114c..90706a5 100644 --- a/internal/provider/filter_resource.go +++ b/internal/provider/filter_resource.go @@ -129,18 +129,9 @@ func (r *FilterResource) Create(ctx context.Context, req resource.CreateRequest, var createFilter Ambar.CreateFilterRequest createFilter.Description = plan.Description.ValueStringPointer() - // Filters we encode the content string in base64 for API requests to compact complex filters and prevent white spaces - // from giving any issues. If the customer already encoded the contents, great. But it is not required. So we will - // check if they already did it, and otherwise encode it. - _, err := base64.StdEncoding.DecodeString(plan.FilterContents.ValueString()) - if err != nil { - // decoding failed, and we will want to encode and assign - encodedContents := base64.StdEncoding.EncodeToString([]byte(plan.FilterContents.ValueString())) - createFilter.FilterContents = encodedContents - } else { - // customer already base64 encoded, so just pass it on through. - createFilter.FilterContents = plan.FilterContents.ValueString() - } + // Encode the customers filter string + encodedContents := base64.StdEncoding.EncodeToString([]byte(plan.FilterContents.ValueString())) + createFilter.FilterContents = encodedContents createFilter.DataSourceId = plan.DataSourceId.ValueString()