Skip to content
Draft
Changes from 1 commit
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
14 changes: 13 additions & 1 deletion internal/service/elasticache/serverless_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,19 @@ func (r *serverlessCacheResource) Schema(ctx context.Context, request resource.S
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
stringplanmodifier.RequiresReplace(),
stringplanmodifier.RequiresReplaceIf(
func(ctx context.Context, req planmodifier.StringRequest, resp *stringplanmodifier.RequiresReplaceIfFuncResponse) {
// Not replacing if upgrading from 7 to 8
if req.StateValue.Equal(types.StringValue("7")) && req.PlanValue.Equal(types.StringValue("8")) {
return
}

// Any other change will force a replacement
resp.RequiresReplace = true
},
"major_engine_version change other than 7 to 8 needs replacement",
"major_engine_version change other than 7 to 8 needs replacement",
),
},
},
names.AttrName: schema.StringAttribute{
Expand Down
Loading