Skip to content

Commit 6eff2ab

Browse files
committed
fix: make global_data_persistence computed to reflect API default
1 parent 3ed10b6 commit 6eff2ab

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

provider/activeactive/resource_active_active_database.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ func (r *activeActiveDatabaseResource) Schema(_ context.Context, _ resource.Sche
218218
"global_data_persistence": schema.StringAttribute{
219219
Description: "Rate of database data persistence (in persistent storage)",
220220
Optional: true,
221+
Computed: true,
222+
PlanModifiers: []planmodifier.String{
223+
stringplanmodifier.UseStateForUnknown(),
224+
},
221225
},
222226
"global_password": schema.StringAttribute{
223227
Description: "Password used to access the database. If left empty, the password will be generated automatically",

provider/activeactive/resource_active_active_database_crud.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ func (r *activeActiveDatabaseResource) readDatabase(ctx context.Context, state *
193193
state.ExternalEndpointForOssClusterAPI = types.BoolValue(redis.BoolValue(db.UseExternalEndpointForOSSClusterAPI))
194194
state.RedisVersion = types.StringValue(redis.StringValue(db.RedisVersion))
195195

196-
// Set global_data_persistence - Optional-only, preserve config if set
197-
utils.SetStringPreserveConfig(&state.GlobalDataPersistence, db.GlobalDataPersistence)
196+
// Set global_data_persistence - Optional+Computed, always from API
197+
utils.SetStringFromAPI(&state.GlobalDataPersistence, db.GlobalDataPersistence)
198198

199199
// Set global_password - Optional+Computed, always from API
200200
utils.SetStringFromAPI(&state.GlobalPassword, db.GlobalPassword)

0 commit comments

Comments
 (0)