@@ -45,18 +45,29 @@ var (
4545 ExaDbVmClusterRemoteClonePdbCreationTypeDetailsRepresentation = map [string ]interface {}{
4646 "creation_type" : acctest.Representation {RepType : acctest .Required , Create : `REMOTE_CLONE_PDB` },
4747 "source_container_database_admin_password" : acctest.Representation {RepType : acctest .Required , Create : `BEstrO0ng_#11` },
48- "source_pluggable_database_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.source_pluggable_database_id}` },
48+ "source_pluggable_database_id" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_database_pluggable_database_snapshot.source_pdb_snapshot.pluggable_database_id}` },
49+ "source_pluggable_database_snapshot_id" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_database_pluggable_database_snapshot.source_pdb_snapshot.id}` },
4950 "is_thin_clone" : acctest.Representation {RepType : acctest .Required , Create : `true` },
5051 }
5152
5253 ExaDbVmClusterRemoteClonePdbIgnoreDefinedTagsRepresentation = map [string ]interface {}{
5354 "ignore_changes" : acctest.Representation {RepType : acctest .Required , Create : []string {`defined_tags` }},
5455 }
5556
56- // Note: set env variable TF_VAR_source_pluggable_database_id and TF_VAR_destination_database_id before running this test
57+ // Note: set env variable TF_VAR_source_pdb_snapshot_id and TF_VAR_destination_database_id before running this test
58+ ExaDbVmClusterRemoteCloneSourcePDBSnapshotSingularDataSourceRepresentation = map [string ]interface {}{
59+ "pluggable_database_snapshot_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.source_pdb_snapshot_id}` },
60+ }
61+
62+ ExaDbVmClusterRemoteCloneSourcePDBSingularDataSourceRepresentation = map [string ]interface {}{
63+ "pluggable_database_id" : acctest.Representation {RepType : acctest .Required , Create : `${data.oci_database_pluggable_database_snapshot.source_pdb_snapshot.pluggable_database_id}` },
64+ }
65+
5766 ExaDbVmClusterRemoteClonePdbResourceDependencies = `
58- variable "source_pluggable_database_id" {}
59- variable "destination_database_id" {}`
67+ variable "source_pdb_snapshot_id" {}
68+ variable "destination_database_id" {}` +
69+ acctest .GenerateDataSourceFromRepresentationMap ("oci_database_pluggable_database_snapshot" , "source_pdb_snapshot" , acctest .Optional , acctest .Create , ExaDbVmClusterRemoteCloneSourcePDBSnapshotSingularDataSourceRepresentation ) +
70+ acctest .GenerateDataSourceFromRepresentationMap ("oci_database_pluggable_database" , "source_pdb" , acctest .Optional , acctest .Create , ExaDbVmClusterRemoteCloneSourcePDBSingularDataSourceRepresentation )
6071)
6172
6273// issue-routing-tag: database/ExaCS
@@ -94,6 +105,7 @@ func TestDatabaseExaDbVmClusterPluggableDatabaseResource_remoteThinClone(t *test
94105 resource .TestCheckResourceAttr (resourceName , "pdb_creation_type_details.0.creation_type" , "REMOTE_CLONE_PDB" ),
95106 resource .TestCheckResourceAttr (resourceName , "pdb_creation_type_details.0.is_thin_clone" , "true" ),
96107 resource .TestCheckResourceAttrSet (resourceName , "pdb_creation_type_details.0.source_pluggable_database_id" ),
108+ resource .TestCheckResourceAttrSet (resourceName , "pdb_creation_type_details.0.source_pluggable_database_snapshot_id" ),
97109 resource .TestCheckResourceAttrSet (resourceName , "pdb_creation_type_details.0.source_container_database_admin_password" ),
98110 ),
99111 },
0 commit comments