@@ -51,21 +51,27 @@ var (
5151 }
5252
5353 CoreBootVolumeRepresentation = map [string ]interface {}{
54- "availability_domain" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}` },
55- "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
56- "source_details" : acctest.RepresentationGroup {RepType : acctest .Required , Group : CoreBootVolumeSourceDetailsRepresentation },
57- "backup_policy_id" : acctest.Representation {RepType : acctest .Optional , Create : `${data.oci_core_volume_backup_policies.test_volume_backup_policies.volume_backup_policies.0.id}` },
58- "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
59- "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
60- "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"Department" : "Finance" }, Update : map [string ]string {"Department" : "Accounting" }},
61- "kms_key_id" : acctest.Representation {RepType : acctest .Optional , Create : `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}` },
62- "size_in_gbs" : acctest.Representation {RepType : acctest .Optional , Create : `50` , Update : `51` },
63- "vpus_per_gb" : acctest.Representation {RepType : acctest .Optional , Create : `10` , Update : `20` },
54+ "availability_domain" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}` },
55+ "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
56+ "source_details" : acctest.RepresentationGroup {RepType : acctest .Required , Group : CoreBootVolumeSourceDetailsRepresentation },
57+ "backup_policy_id" : acctest.Representation {RepType : acctest .Optional , Create : `${data.oci_core_volume_backup_policies.test_volume_backup_policies.volume_backup_policies.0.id}` },
58+ "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
59+ "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
60+ "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"Department" : "Finance" }, Update : map [string ]string {"Department" : "Accounting" }},
61+ "kms_key_id" : acctest.Representation {RepType : acctest .Optional , Create : `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}` },
62+ "size_in_gbs" : acctest.Representation {RepType : acctest .Optional , Create : `50` , Update : `51` },
63+ "vpus_per_gb" : acctest.Representation {RepType : acctest .Optional , Create : `10` , Update : `10` },
64+ "autotune_policies" : acctest.RepresentationGroup {RepType : acctest .Optional , Group : bootVolumeAutotunePoliciesRepresentation },
65+ "is_auto_tune_enabled" : acctest.Representation {RepType : acctest .Optional , Create : `false` , Update : `false` },
6466 }
6567 CoreBootVolumeSourceDetailsRepresentation = map [string ]interface {}{
6668 "id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_instance.test_instance.boot_volume_id}` },
6769 "type" : acctest.Representation {RepType : acctest .Required , Create : `bootVolume` },
6870 }
71+ bootVolumeAutotunePoliciesRepresentation = map [string ]interface {}{
72+ "autotune_type" : acctest.Representation {RepType : acctest .Required , Create : `PERFORMANCE_BASED` , Update : `PERFORMANCE_BASED` },
73+ "max_vpus_per_gb" : acctest.Representation {RepType : acctest .Optional , Create : `20` , Update : `30` },
74+ }
6975 CoreBootVolumeBootVolumeReplicasRepresentation = map [string ]interface {}{
7076 "availability_domain" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}` , Update : `availabilityDomain2` },
7177 "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
@@ -135,6 +141,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
135141 Config : config + compartmentIdVariableStr + CoreBootVolumeResourceDependencies +
136142 acctest .GenerateResourceFromRepresentationMap ("oci_core_boot_volume" , "test_boot_volume" , acctest .Optional , acctest .Create , CoreBootVolumeRepresentation ),
137143 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
144+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.#" , "1" ),
145+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.autotune_type" , "PERFORMANCE_BASED" ),
146+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.max_vpus_per_gb" , "20" ),
138147 resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
139148 resource .TestCheckResourceAttrSet (resourceName , "backup_policy_id" ),
140149 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
@@ -172,6 +181,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
172181 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id_for_update}` },
173182 })),
174183 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
184+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.#" , "1" ),
185+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.autotune_type" , "PERFORMANCE_BASED" ),
186+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.max_vpus_per_gb" , "20" ),
175187 resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
176188 resource .TestCheckResourceAttrSet (resourceName , "backup_policy_id" ),
177189 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentIdU ),
@@ -206,6 +218,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
206218 Config : config + compartmentIdVariableStr + CoreBootVolumeResourceDependencies +
207219 acctest .GenerateResourceFromRepresentationMap ("oci_core_boot_volume" , "test_boot_volume" , acctest .Optional , acctest .Update , CoreBootVolumeRepresentation ),
208220 Check : acctest .ComposeAggregateTestCheckFuncWrapper (
221+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.#" , "1" ),
222+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.autotune_type" , "PERFORMANCE_BASED" ),
223+ resource .TestCheckResourceAttr (resourceName , "autotune_policies.0.max_vpus_per_gb" , "30" ),
209224 resource .TestCheckResourceAttrSet (resourceName , "availability_domain" ),
210225 resource .TestCheckResourceAttrSet (resourceName , "backup_policy_id" ),
211226 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
@@ -220,7 +235,7 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
220235 resource .TestCheckResourceAttr (resourceName , "source_details.0.type" , "bootVolume" ),
221236 resource .TestCheckResourceAttrSet (resourceName , "state" ),
222237 resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
223- resource .TestCheckResourceAttr (resourceName , "vpus_per_gb" , "20 " ),
238+ resource .TestCheckResourceAttr (resourceName , "vpus_per_gb" , "10 " ),
224239 resource .TestCheckNoResourceAttr (resourceName , "volume_group_id" ),
225240
226241 func (s * terraform.State ) (err error ) {
@@ -246,6 +261,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
246261 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
247262
248263 resource .TestCheckResourceAttr (datasourceName , "boot_volumes.#" , "1" ),
264+ resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.autotune_policies.#" , "1" ),
265+ resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.autotune_policies.0.autotune_type" , "PERFORMANCE_BASED" ),
266+ resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.autotune_policies.0.max_vpus_per_gb" , "30" ),
249267 resource .TestCheckResourceAttrSet (datasourceName , "boot_volumes.0.availability_domain" ),
250268 resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.compartment_id" , compartmentId ),
251269 resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.display_name" , "displayName2" ),
@@ -260,7 +278,7 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
260278 resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.source_details.0.type" , "bootVolume" ),
261279 resource .TestCheckResourceAttrSet (datasourceName , "boot_volumes.0.state" ),
262280 resource .TestCheckResourceAttrSet (datasourceName , "boot_volumes.0.time_created" ),
263- resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.vpus_per_gb" , "20 " ),
281+ resource .TestCheckResourceAttr (datasourceName , "boot_volumes.0.vpus_per_gb" , "10 " ),
264282 ),
265283 },
266284 // verify singular datasource
@@ -273,6 +291,9 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
273291 resource .TestCheckResourceAttrSet (singularDatasourceName , "boot_volume_id" ),
274292 resource .TestCheckResourceAttrSet (singularDatasourceName , "kms_key_id" ),
275293
294+ resource .TestCheckResourceAttr (singularDatasourceName , "autotune_policies.#" , "1" ),
295+ resource .TestCheckResourceAttr (singularDatasourceName , "autotune_policies.0.autotune_type" , "PERFORMANCE_BASED" ),
296+ resource .TestCheckResourceAttr (singularDatasourceName , "autotune_policies.0.max_vpus_per_gb" , "30" ),
276297 resource .TestCheckResourceAttrSet (singularDatasourceName , "availability_domain" ),
277298 resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
278299 resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "displayName2" ),
@@ -287,7 +308,7 @@ func TestCoreBootVolumeResource_basic(t *testing.T) {
287308 resource .TestCheckResourceAttr (singularDatasourceName , "source_details.0.type" , "bootVolume" ),
288309 resource .TestCheckResourceAttrSet (singularDatasourceName , "state" ),
289310 resource .TestCheckResourceAttrSet (singularDatasourceName , "time_created" ),
290- resource .TestCheckResourceAttr (singularDatasourceName , "vpus_per_gb" , "20 " ),
311+ resource .TestCheckResourceAttr (singularDatasourceName , "vpus_per_gb" , "10 " ),
291312 ),
292313 },
293314 // verify resource import
0 commit comments