6666 "kms_key_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.kms_key_id}` , Update : `${var.kms_key_id_for_update}` },
6767 //"cloud_sql_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: bdsInstanceNodesOdhCloudSqlRepresentation}, // capacity issue
6868
69- "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")}` },
69+ //Uncomment this when running in home region (PHX)
70+ // "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")}`},
7071 "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"Department" : "Accounting" }},
7172 "network_config" : acctest.RepresentationGroup {RepType : acctest .Optional , Group : bdsInstanceOdhNetworkConfigRepresentation },
7273 }
@@ -85,31 +86,32 @@ var (
8586 })
8687
8788 bdsInstanceNodesOdhCloudSqlRepresentation = map [string ]interface {}{
88- "shape" : acctest.Representation {RepType : acctest .Required , Create : `VM.Standard2.4 ` },
89+ "shape" : acctest.Representation {RepType : acctest .Required , Create : `BM.Standard.E4.128 ` },
8990 "block_volume_size_in_gbs" : acctest.Representation {RepType : acctest .Required , Create : `1000` },
91+ // "nvmes": acctest.Representation{RepType: acctest.Optional, Create: `10`}, // Only for VM_DenseIO_E4_Flex. The shape is disabled for now
9092 }
9193
9294 bdsInstanceNodesOdhMasterRepresentation = map [string ]interface {}{
9395 "shape" : acctest.Representation {RepType : acctest .Required , Create : `VM.Standard2.4` },
94- "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_subnet.test_subnet.id }` },
96+ "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.subnet_id }` },
9597 "block_volume_size_in_gbs" : acctest.Representation {RepType : acctest .Required , Create : `150` },
9698 "number_of_nodes" : acctest.Representation {RepType : acctest .Required , Create : `2` },
9799 }
98100 bdsInstanceNodesOdhUtilRepresentation = map [string ]interface {}{
99101 "shape" : acctest.Representation {RepType : acctest .Required , Create : `VM.Standard2.4` },
100- "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_subnet.test_subnet.id }` },
102+ "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.subnet_id }` },
101103 "block_volume_size_in_gbs" : acctest.Representation {RepType : acctest .Required , Create : `150` },
102104 "number_of_nodes" : acctest.Representation {RepType : acctest .Required , Create : `2` },
103105 }
104106 bdsInstanceNodesOdhWorkerRepresentation = map [string ]interface {}{
105- "shape" : acctest.Representation {RepType : acctest .Required , Create : `VM.Standard2.1 ` },
106- "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_subnet.test_subnet.id }` },
107+ "shape" : acctest.Representation {RepType : acctest .Required , Create : `BM.Standard.E4.128 ` },
108+ "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.subnet_id }` },
107109 "block_volume_size_in_gbs" : acctest.Representation {RepType : acctest .Required , Create : `150` },
108110 "number_of_nodes" : acctest.Representation {RepType : acctest .Required , Create : `3` , Update : `4` },
109111 }
110112 bdsInstanceNodeFlexShapeRepresentation = map [string ]interface {}{
111113 "shape" : acctest.Representation {RepType : acctest .Required , Create : `VM.Standard.E4.Flex` },
112- "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_subnet.test_subnet.id }` },
114+ "subnet_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.subnet_id }` },
113115 "block_volume_size_in_gbs" : acctest.Representation {RepType : acctest .Required , Create : `150` },
114116 "number_of_nodes" : acctest.Representation {RepType : acctest .Required , Create : `2` },
115117 "shape_config" : acctest.RepresentationGroup {RepType : acctest .Required , Group : bdsInstanceNodesShapeConfigRepresentation },
@@ -132,7 +134,7 @@ var (
132134 []string {"cidr_block" , "dns_label" },
133135 []interface {}{acctest.Representation {RepType : acctest .Required , Create : `111.111.0.0/16` }, acctest.Representation {RepType : acctest .Required , Create : `bdsvcn` }},
134136 CoreVcnRepresentation )) +
135- DefinedTagsDependencies +
137+ // DefinedTagsDependencies +
136138 KeyResourceDependencyConfig
137139)
138140
@@ -149,6 +151,9 @@ func TestResourceBdsOdhInstance(t *testing.T) {
149151 compartmentIdU := utils .GetEnvSettingWithDefault ("compartment_id_for_update" , compartmentId )
150152 compartmentIdUVariableStr := fmt .Sprintf ("variable \" compartment_id_for_update\" { default = \" %s\" }\n " , compartmentIdU )
151153
154+ subnetId := utils .GetEnvSettingWithBlankDefault ("subnet_ocid" )
155+ subnetIdVariableStr := fmt .Sprintf ("variable \" subnet_id\" { default = \" %s\" }\n " , subnetId )
156+
152157 kmsKeyId := utils .GetEnvSettingWithBlankDefault ("kms_key_ocid" )
153158 kmsKeyIdVariableStr := fmt .Sprintf ("variable \" kms_key_id\" { default = \" %s\" }\n " , kmsKeyId )
154159
@@ -170,7 +175,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
170175 acctest .ResourceTest (t , testAccCheckBdsBdsInstanceOdhDestroy , []resource.TestStep {
171176 // verify Create
172177 {
173- Config : config + compartmentIdVariableStr + kmsKeyIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr +
178+ Config : config + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr +
174179 acctest .GenerateResourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Required , acctest .Create , bdsInstanceOdhRepresentation ),
175180 Check : resource .ComposeAggregateTestCheckFunc (
176181 resource .TestCheckResourceAttr (resourceName , "cluster_admin_password" , "T3JhY2xlVGVhbVVTQSExMjM=" ),
@@ -197,7 +202,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
197202 },
198203 // verify Create with optionals
199204 {
200- Config : config + compartmentIdVariableStr + kmsKeyIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr +
205+ Config : config + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr +
201206 acctest .GenerateResourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Optional , acctest .Create , bdsInstanceOdhRepresentation ),
202207 Check : resource .ComposeAggregateTestCheckFunc (
203208 resource .TestCheckResourceAttr (resourceName , "bootstrap_script_url" , bootstrapScriptUrl ),
@@ -245,7 +250,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
245250
246251 // verify Update to the compartment (the compartment will be switched back in the next step) and change shapes
247252 {
248- Config : config + compartmentIdVariableStr + compartmentIdUVariableStr + kmsKeyIdVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies +
253+ Config : config + compartmentIdVariableStr + compartmentIdUVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies +
249254 acctest .GenerateResourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Optional , acctest .Create ,
250255 acctest .RepresentationCopyWithNewProperties (bdsInstanceOdhWithFlexComputeAndRegularMasterUtilRepresentation , map [string ]interface {}{
251256 "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id_for_update}` },
@@ -294,7 +299,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
294299
295300 // verify updates to updatable parameters, add a worker, update compute worker flex->regular, update util regular -> flex
296301 {
297- Config : config + compartmentIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies +
302+ Config : config + compartmentIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies +
298303 acctest .GenerateResourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Optional , acctest .Update , bdsInstanceOdhWithRegularComputeAndFlexMasterUtilRepresentation ),
299304 Check : resource .ComposeAggregateTestCheckFunc (
300305 resource .TestCheckResourceAttr (resourceName , "cluster_admin_password" , "T3JhY2xlVGVhbVVTQSExMjM=" ),
@@ -327,10 +332,6 @@ func TestResourceBdsOdhInstance(t *testing.T) {
327332 resource .TestCheckResourceAttr (resourceName , "util_node.0.shape" , "VM.Standard.E4.Flex" ),
328333 resource .TestCheckResourceAttr (resourceName , "master_node.0.shape" , "VM.Standard.E4.Flex" ),
329334 resource .TestCheckResourceAttr (resourceName , "compute_only_worker_node.0.shape" , "VM.Standard2.4" ),
330- // Change shape not supported for ODH on GA
331- //resource.TestCheckResourceAttr(resourceName, "master_node.0.shape", "VM.Standard2.8"),
332- //resource.TestCheckResourceAttr(resourceName, "worker_node.0.shape", "VM.Standard2.4"),
333- //resource.TestCheckResourceAttr(resourceName, "util_node.0.shape", "VM.Standard2.8"),
334335
335336 func (s * terraform.State ) (err error ) {
336337 resId2 , err = acctest .FromInstanceState (s , resourceName , "id" )
@@ -345,7 +346,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
345346 {
346347 Config : config +
347348 acctest .GenerateDataSourceFromRepresentationMap ("oci_bds_bds_instances" , "test_bds_instances" , acctest .Optional , acctest .Update , bdsInstanceOdhDataSourceRepresentation ) +
348- compartmentIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies +
349+ compartmentIdVariableStr + kmsKeyIdUVariableStr + subnetIdVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies +
349350 acctest .GenerateResourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Optional , acctest .Update , bdsInstanceOdhWithRegularComputeAndFlexMasterUtilRepresentation ),
350351 Check : resource .ComposeAggregateTestCheckFunc (
351352 resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
@@ -369,7 +370,7 @@ func TestResourceBdsOdhInstance(t *testing.T) {
369370 {
370371 Config : config +
371372 acctest .GenerateDataSourceFromRepresentationMap ("oci_bds_bds_instance" , "test_bds_instance" , acctest .Required , acctest .Create , bdsInstanceOdhSingularDataSourceRepresentation ) +
372- compartmentIdVariableStr + kmsKeyIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhWithRegularComputeWorkerResourceConfig ,
373+ compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhWithRegularComputeWorkerResourceConfig ,
373374 Check : resource .ComposeAggregateTestCheckFunc (
374375 resource .TestCheckResourceAttrSet (singularDatasourceName , "bds_instance_id" ),
375376
0 commit comments