|
43 | 43 | "ocpus": Representation{repType: Optional, create: "2"}, |
44 | 44 | "memory_in_gbs": Representation{repType: Optional, create: `10.0`, update: `20.0`}, |
45 | 45 | } |
46 | | - instanceShapeConfigRepresentation_ForFlexibleMemoryNoUpdate = map[string]interface{}{ |
47 | | - "ocpus": Representation{repType: Optional, create: "2"}, |
48 | | - "memory_in_gbs": Representation{repType: Optional, create: `10.0`, update: `20.0`}, |
49 | | - } |
50 | | - instanceRepresentationCore_ForFlexibleMemoryNoUpdate = representationCopyWithRemovedProperties(representationCopyWithNewProperties(instanceRepresentation, map[string]interface{}{ |
51 | | - "fault_domain": Representation{repType: Optional, create: `FAULT-DOMAIN-3`, update: `FAULT-DOMAIN-2`}, |
52 | | - "shape": Representation{repType: Required, create: `VM.Standard.E3.Flex`}, |
53 | | - "image": Representation{repType: Required, create: `${var.FlexInstanceImageOCID[var.region]}`}, |
54 | | - "shape_config": RepresentationGroup{Optional, instanceShapeConfigRepresentation_ForFlexibleMemoryNoUpdate}, |
55 | | - "source_details": RepresentationGroup{Optional, instanceFlexSourceDetailsRepresentation}, |
56 | | - }), []string{ |
57 | | - "dedicated_vm_host_id", |
58 | | - }) |
59 | 46 | instanceLaunchOptionsRepresentation_ForLaunchOptionsUpdate = representationCopyWithNewProperties(instanceLaunchOptionsRepresentation, map[string]interface{}{ |
60 | 47 | "boot_volume_type": Representation{repType: Optional, create: `ISCSI`, update: `PARAVIRTUALIZED`}, |
61 | 48 | "is_pv_encryption_in_transit_enabled": Representation{repType: Optional, update: `true`}, |
@@ -1834,58 +1821,6 @@ func TestAccResourceCoreInstance_FlexibleMemory(t *testing.T) { |
1834 | 1821 | ), |
1835 | 1822 | }, |
1836 | 1823 |
|
1837 | | - // verify updates to updatable parameters but no change in shape_config |
1838 | | - { |
1839 | | - Config: config + compartmentIdVariableStr + InstanceResourceDependenciesWithoutDHV + FlexVmImageIdsVariable + |
1840 | | - generateResourceFromRepresentationMap("oci_core_instance", "test_instance", Optional, Update, instanceRepresentationCore_ForFlexibleMemoryNoUpdate), |
1841 | | - Check: resource.ComposeAggregateTestCheckFunc( |
1842 | | - resource.TestCheckResourceAttr(resourceName, "agent_config.#", "1"), |
1843 | | - resource.TestCheckResourceAttr(resourceName, "agent_config.0.is_management_disabled", "true"), |
1844 | | - resource.TestCheckResourceAttr(resourceName, "agent_config.0.is_monitoring_disabled", "true"), |
1845 | | - resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), |
1846 | | - resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), |
1847 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.#", "1"), |
1848 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.assign_public_ip", "true"), |
1849 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.defined_tags.%", "1"), |
1850 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.display_name", "displayName"), |
1851 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.freeform_tags.%", "1"), |
1852 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.hostname_label", "hostnamelabel"), |
1853 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.nsg_ids.#", "0"), |
1854 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.private_ip", "10.0.0.5"), |
1855 | | - resource.TestCheckResourceAttr(resourceName, "create_vnic_details.0.skip_source_dest_check", "false"), |
1856 | | - resource.TestCheckResourceAttrSet(resourceName, "create_vnic_details.0.subnet_id"), |
1857 | | - resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"), |
1858 | | - resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), |
1859 | | - resource.TestCheckResourceAttr(resourceName, "extended_metadata.%", "3"), |
1860 | | - resource.TestCheckResourceAttr(resourceName, "fault_domain", "FAULT-DOMAIN-2"), |
1861 | | - resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), |
1862 | | - resource.TestCheckResourceAttr(resourceName, "hostname_label", "hostnamelabel"), |
1863 | | - resource.TestCheckResourceAttrSet(resourceName, "id"), |
1864 | | - resource.TestCheckResourceAttrSet(resourceName, "image"), |
1865 | | - resource.TestCheckResourceAttr(resourceName, "ipxe_script", "ipxeScript"), |
1866 | | - resource.TestCheckResourceAttr(resourceName, "is_pv_encryption_in_transit_enabled", "false"), |
1867 | | - resource.TestCheckResourceAttr(resourceName, "metadata.%", "2"), |
1868 | | - resource.TestCheckResourceAttrSet(resourceName, "region"), |
1869 | | - resource.TestCheckResourceAttr(resourceName, "shape", "VM.Standard.E3.Flex"), |
1870 | | - resource.TestCheckResourceAttr(resourceName, "shape_config.#", "1"), |
1871 | | - resource.TestCheckResourceAttr(resourceName, "shape_config.0.memory_in_gbs", "20"), |
1872 | | - resource.TestCheckResourceAttr(resourceName, "source_details.#", "1"), |
1873 | | - resource.TestCheckResourceAttrSet(resourceName, "source_details.0.source_id"), |
1874 | | - resource.TestCheckResourceAttr(resourceName, "source_details.0.source_type", "image"), |
1875 | | - resource.TestCheckResourceAttr(resourceName, "state", "RUNNING"), |
1876 | | - resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), |
1877 | | - resource.TestCheckResourceAttrSet(resourceName, "time_created"), |
1878 | | - |
1879 | | - func(s *terraform.State) (err error) { |
1880 | | - resId2, err = fromInstanceState(s, resourceName, "id") |
1881 | | - if resId != resId2 { |
1882 | | - return fmt.Errorf("Resource recreated when it was supposed to be updated.") |
1883 | | - } |
1884 | | - return err |
1885 | | - }, |
1886 | | - ), |
1887 | | - }, |
1888 | | - |
1889 | 1824 | // verify updates to updatable parameters |
1890 | 1825 | { |
1891 | 1826 | Config: config + compartmentIdVariableStr + InstanceResourceDependenciesWithoutDHV + FlexVmImageIdsVariable + |
|
0 commit comments