Skip to content

Commit

Permalink
change the id only if there is one replication spec (#1755)
Browse files Browse the repository at this point in the history
  • Loading branch information
lantoli authored Dec 13, 2023
1 parent cf54814 commit c0ae26a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/service/cluster/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,8 @@ func expandReplicationSpecs(d *schema.ResourceData) ([]matlas.ReplicationSpec, e
break
}
}
if id == "" && oldSpecs != nil {
// If there was an item before and after then use the same id assuming it's the same replication spec
if id == "" && oldSpecs != nil && len(vRSpecs.(*schema.Set).List()) == 1 && len(original.(*schema.Set).List()) == 1 {
id = oldSpecs["id"].(string)
}
}
Expand Down

0 comments on commit c0ae26a

Please sign in to comment.