@@ -332,6 +332,32 @@ func TestAccODBCloudVmCluster_usingARN(t *testing.T) {
332332 })
333333}
334334
335+ func TestAccODBCloudVmCluster_variables (t * testing.T ) {
336+ ctx := acctest .Context (t )
337+ if testing .Short () {
338+ t .Skip ("skipping long-running test in short mode" )
339+ }
340+
341+ vmcDisplayName := sdkacctest .RandomWithPrefix (vmClusterTestEntity .vmClusterDisplayNamePrefix )
342+ resource .ParallelTest (t , resource.TestCase {
343+ PreCheck : func () {
344+ acctest .PreCheck (ctx , t )
345+ vmClusterTestEntity .testAccPreCheck (ctx , t )
346+ },
347+ ErrorCheck : acctest .ErrorCheck (t , names .ODBServiceID ),
348+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories ,
349+ CheckDestroy : vmClusterTestEntity .testAccCheckCloudVmClusterDestroy (ctx ),
350+ Steps : []resource.TestStep {
351+ // nosemgrep:ci.semgrep.acctest.checks.replace-planonly-checks
352+ {
353+ Config : testAccCloudVmClusterConfig_useVariables (vmcDisplayName ),
354+ PlanOnly : true ,
355+ ExpectNonEmptyPlan : true ,
356+ },
357+ },
358+ })
359+ }
360+
335361func (cloudVmClusterResourceTest ) testAccCheckCloudVmClusterDestroy (ctx context.Context ) resource.TestCheckFunc {
336362 return func (s * terraform.State ) error {
337363 conn := acctest .Provider .Meta ().(* conns.AWSClient ).ODBClient (ctx )
@@ -383,6 +409,43 @@ func (cloudVmClusterResourceTest) testAccPreCheck(ctx context.Context, t *testin
383409 }
384410}
385411
412+ func testAccCloudVmClusterConfig_useVariables (rName string ) string {
413+ return fmt .Sprintf (`
414+ variable cloud_exadata_infrastructure_id {
415+ default = "exa_gjrmtxl4qk"
416+ type = string
417+ description = "ODB Exadata Infrastructure Resource ID"
418+
419+ }
420+ variable odb_network_id {
421+ default = "odbnet_3l9st3litg"
422+ type = string
423+ description = "ODB Network"
424+ }
425+
426+ resource "aws_odb_cloud_vm_cluster" "test" {
427+ display_name = %[1]q
428+ cloud_exadata_infrastructure_id = var.cloud_exadata_infrastructure_id
429+ cpu_core_count = 6
430+ gi_version = "23.0.0.0"
431+ hostname_prefix = "apollo12"
432+ ssh_public_keys = ["public-ssh-key"]
433+ odb_network_id = var.odb_network_id
434+ is_local_backup_enabled = true
435+ is_sparse_diskgroup_enabled = true
436+ license_model = "LICENSE_INCLUDED"
437+ data_storage_size_in_tbs = 20.0
438+ db_servers = ["db-server-1", "db-server-2"]
439+ db_node_storage_size_in_gbs = 120.0
440+ memory_size_in_gbs = 60
441+ data_collection_options {
442+ is_diagnostics_events_enabled = false
443+ is_health_monitoring_enabled = false
444+ is_incident_logs_enabled = false
445+ }
446+ }
447+ ` , rName )
448+ }
386449func (cloudVmClusterResourceTest ) testAccCloudVmClusterConfigBasic (vmClusterDisplayName , sshKey string ) (string , string ) {
387450 exaInfraDisplayName := sdkacctest .RandomWithPrefix (vmClusterTestEntity .exaInfraDisplayNamePrefix )
388451 odbNetDisplayName := sdkacctest .RandomWithPrefix (vmClusterTestEntity .odbNetDisplayNamePrefix )
0 commit comments