6767 acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceConfigurationInstanceDetailsLaunchDetailsRepresentationForFlexShape },
6868 instanceConfigurationInstanceDetailsLaunchRepresentation )
6969
70+ instanceConfigurationInstanceDetailsLaunchRepresentationForDenseShape = acctest .GetUpdatedRepresentationCopy ("launch_details" ,
71+ acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceConfigurationInstanceDetailsLaunchDetailsRepresentationForDenseShape },
72+ instanceConfigurationInstanceDetailsLaunchRepresentation )
73+
7074 instanceConfigurationInstanceDetailsBlockRepresentation = map [string ]interface {}{
7175 "instance_type" : acctest.Representation {RepType : acctest .Required , Create : `compute` },
7276 "block_volumes" : acctest.RepresentationGroup {RepType : acctest .Required , Group : instanceConfigurationInstanceDetailsBlockVolumesRepresentation },
@@ -130,6 +134,17 @@ var (
130134 instanceConfigurationInstanceDetailsLaunchDetailsRepresentation ),
131135 []string {"dedicated_vm_host_id" , "preferred_maintenance_action" },
132136 )
137+ instanceConfigurationInstanceDetailsLaunchDetailsRepresentationForDenseShape = acctest .RepresentationCopyWithRemovedProperties (
138+ acctest .GetMultipleUpdatedRepresenationCopy (
139+ []string {"shape" , "source_details" , "shape_config" },
140+ []interface {}{
141+ acctest.Representation {RepType : acctest .Optional , Create : InstanceConfigurationVmShapeForDense },
142+ acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsRepresentationForDenseShape },
143+ acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceShapeConfigRepresentationForNvmeShape },
144+ },
145+ instanceConfigurationInstanceDetailsLaunchDetailsRepresentation ),
146+ []string {"dedicated_vm_host_id" , "preferred_maintenance_action" },
147+ )
133148 instanceConfigurationInstanceOptionsRepresentation = map [string ]interface {}{
134149 "are_legacy_imds_endpoints_disabled" : acctest.Representation {RepType : acctest .Optional , Create : `false` },
135150 }
@@ -183,6 +198,10 @@ var (
183198 acctest.Representation {RepType : acctest .Optional , Create : `${var.FlexInstanceImageOCID[var.region]}` },
184199 instanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsRepresentation )
185200
201+ instanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsRepresentationForDenseShape = acctest .GetUpdatedRepresentationCopy ("image_id" ,
202+ acctest.Representation {RepType : acctest .Optional , Create : `${var.image_id}` },
203+ instanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsRepresentation )
204+
186205 instanceConfigurationInstanceDetailsSecondaryVnicsCreateVnicDetailsRepresentation = map [string ]interface {}{
187206 "assign_private_dns_record" : acctest.Representation {RepType : acctest .Optional , Create : `true` },
188207 "assign_public_ip" : acctest.Representation {RepType : acctest .Optional , Create : `false` },
@@ -211,8 +230,9 @@ var (
211230 AvailabilityDomainConfig +
212231 DefinedTagsDependencies +
213232 KeyResourceDependencyConfig
214- InstanceConfigurationVmShape = `VM.Standard2.1`
215- InstanceConfigurationVmShapeForFlex = `VM.Standard.E3.Flex`
233+ InstanceConfigurationVmShape = `VM.Standard2.1`
234+ InstanceConfigurationVmShapeForFlex = `VM.Standard.E3.Flex`
235+ InstanceConfigurationVmShapeForDense = `VM.DenseIO.E4.Flex`
216236
217237 InstanceConfigurationResourceImageConfig = acctest .GenerateResourceFromRepresentationMap ("oci_core_instance_configuration" , "test_instance_configuration" , acctest .Optional , acctest .Create ,
218238 acctest .GetUpdatedRepresentationCopy ("instance_details" , acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceConfigurationInstanceDetailsLaunchRepresentation }, instanceConfigurationRepresentation ))
@@ -228,6 +248,9 @@ func TestCoreInstanceConfigurationResource_basic(t *testing.T) {
228248 compartmentId := utils .GetEnvSettingWithBlankDefault ("compartment_ocid" )
229249 compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
230250
251+ imageId := utils .GetEnvSettingWithBlankDefault ("image_id" )
252+ imageIdVariableStr := fmt .Sprintf ("variable \" image_id\" { default = \" %s\" }\n " , imageId )
253+
231254 compartmentIdU := utils .GetEnvSettingWithDefault ("compartment_id_for_update" , compartmentId )
232255 compartmentIdUVariableStr := fmt .Sprintf ("variable \" compartment_id_for_update\" { default = \" %s\" }\n " , compartmentIdU )
233256
@@ -339,6 +362,59 @@ func TestCoreInstanceConfigurationResource_basic(t *testing.T) {
339362 ),
340363 },
341364
365+ // delete before next Create
366+ {
367+ Config : config + compartmentIdVariableStr + InstanceConfigurationResourceDependencies ,
368+ },
369+
370+ // verify Create with optionals launch_details for E4 dense shape
371+ {
372+ Config : config + compartmentIdVariableStr + imageIdVariableStr + InstanceConfigurationResourceDependencies +
373+ acctest .GenerateResourceFromRepresentationMap ("oci_core_instance_configuration" , "test_instance_configuration" , acctest .Optional , acctest .Create ,
374+ acctest .GetUpdatedRepresentationCopy ("instance_details" , acctest.RepresentationGroup {RepType : acctest .Optional , Group : instanceConfigurationInstanceDetailsLaunchRepresentationForDenseShape }, instanceConfigurationRepresentation )),
375+ Check : acctest .ComposeAggregateTestCheckFuncWrapper (
376+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
377+ resource .TestCheckResourceAttr (resourceName , "display_name" , "backend-servers" ),
378+ resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
379+ resource .TestCheckResourceAttrSet (resourceName , "id" ),
380+ resource .TestCheckResourceAttr (resourceName , "instance_details.#" , "1" ),
381+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.instance_type" , "compute" ),
382+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.#" , "1" ),
383+ resource .TestCheckResourceAttrSet (resourceName , "instance_details.0.launch_details.0.availability_domain" ),
384+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.compartment_id" , compartmentId ),
385+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.display_name" , "backend-servers" ),
386+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.extended_metadata.%" , "1" ),
387+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.freeform_tags.%" , "1" ),
388+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.ipxe_script" , "ipxeScript" ),
389+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.metadata.%" , "1" ),
390+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.shape" , InstanceConfigurationVmShapeForDense ),
391+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.source_details.#" , "1" ),
392+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.source_details.0.boot_volume_size_in_gbs" , "55" ),
393+ resource .TestCheckResourceAttrSet (resourceName , "instance_details.0.launch_details.0.source_details.0.image_id" ),
394+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.source_details.0.source_type" , "image" ),
395+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.agent_config.0.is_management_disabled" , "false" ),
396+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.agent_config.0.is_monitoring_disabled" , "false" ),
397+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.launch_options.0.network_type" , "PARAVIRTUALIZED" ),
398+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.instance_options.0.are_legacy_imds_endpoints_disabled" , "false" ),
399+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.is_pv_encryption_in_transit_enabled" , "false" ),
400+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.launch_mode" , "NATIVE" ),
401+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.shape_config.0.ocpus" , "8" ),
402+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.shape_config.0.memory_in_gbs" , "128" ),
403+ resource .TestCheckResourceAttr (resourceName , "instance_details.0.launch_details.0.shape_config.0.nvmes" , "1" ),
404+ resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
405+
406+ func (s * terraform.State ) (err error ) {
407+ resId , err = acctest .FromInstanceState (s , resourceName , "id" )
408+ if isEnableExportCompartment , _ := strconv .ParseBool (utils .GetEnvSettingWithDefault ("enable_export_compartment" , "true" )); isEnableExportCompartment {
409+ if errExport := resourcediscovery .TestExportCompartmentWithResourceName (& resId , & compartmentId , resourceName ); errExport != nil {
410+ return errExport
411+ }
412+ }
413+ return err
414+ },
415+ ),
416+ },
417+
342418 // delete before next Create
343419 {
344420 Config : config + compartmentIdVariableStr + InstanceConfigurationResourceDependencies ,
0 commit comments