diff --git a/internal/service/core/core_instance_resource.go b/internal/service/core/core_instance_resource.go index 06548cefe7c..21e41aec3e7 100644 --- a/internal/service/core/core_instance_resource.go +++ b/internal/service/core/core_instance_resource.go @@ -1467,7 +1467,7 @@ func (s *CoreInstanceResourceCrud) Update() error { } } - // Update shape, shape config, platform config, source details, fault domain and launch options + // Update shape, shape config, platform config, source details, fault domain, launch options, and capacity reservation err := s.updateOptionsViaWorkRequest() if err != nil { @@ -1501,10 +1501,6 @@ func (s *CoreInstanceResourceCrud) Update() error { } } - if capacityReservationId, ok := s.D.GetOkExists("capacity_reservation_id"); ok { - tmp := capacityReservationId.(string) - request.CapacityReservationId = &tmp - } if dedicatedVmHostId, ok := s.D.GetOkExists("dedicated_vm_host_id"); ok { tmp := dedicatedVmHostId.(string) request.DedicatedVmHostId = &tmp @@ -4075,6 +4071,11 @@ func (s *CoreInstanceResourceCrud) updateOptionsViaWorkRequest() error { } } + if capacityReservationId, ok := s.D.GetOkExists("capacity_reservation_id"); ok { + tmp := capacityReservationId.(string) + request.CapacityReservationId = &tmp + } + if platformConfig, ok := s.D.GetOkExists("platform_config"); ok && s.D.HasChange("platform_config") { if tmpList := platformConfig.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "platform_config", 0)