7171 "subnet_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.test_subnet_id}` },
7272 "vault_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.vault_id}` },
7373 }
74+
75+ PostgresqlConnectionRepresentation = map [string ]interface {}{
76+ "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
77+ "connection_type" : acctest.Representation {RepType : acctest .Required , Create : `POSTGRESQL` },
78+ "display_name" : acctest.Representation {RepType : acctest .Required , Create : `Postgresql_TFtest` , Update : `Postgresql_TFtest2` },
79+ "database_name" : acctest.Representation {RepType : acctest .Required , Create : `TF_PostgresqlDB` },
80+ "technology_type" : acctest.Representation {RepType : acctest .Required , Create : `POSTGRESQL_SERVER` },
81+ "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
82+ "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"bar-key" : "value" }},
83+ "key_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.kms_key_id}` },
84+ "host" : acctest.Representation {RepType : acctest .Required , Create : `10.0.0.127` , Update : `10.0.0.128` },
85+ "port" : acctest.Representation {RepType : acctest .Required , Create : `12` , Update : `13` },
86+ "private_ip" : acctest.Representation {RepType : acctest .Optional , Create : `10.0.1.78` },
87+ "password" : acctest.Representation {RepType : acctest .Required , Create : `bEStrO0nG_1` },
88+ "security_protocol" : acctest.Representation {RepType : acctest .Required , Create : `PLAIN` },
89+ "subnet_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.test_subnet_id}` },
90+ "vault_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.vault_id}` },
91+ "username" : acctest.Representation {RepType : acctest .Required , Create : `admin` },
92+ }
93+
94+ AzureSynapseConnectionRepresentation = map [string ]interface {}{
95+ "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
96+ "connection_type" : acctest.Representation {RepType : acctest .Required , Create : `AZURE_SYNAPSE_ANALYTICS` },
97+ "display_name" : acctest.Representation {RepType : acctest .Required , Create : `displayName` , Update : `displayName2` },
98+ "technology_type" : acctest.Representation {RepType : acctest .Required , Create : `AZURE_SYNAPSE_ANALYTICS` },
99+ "description" : acctest.Representation {RepType : acctest .Optional , Create : `description` , Update : `description2` },
100+ "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"bar-key" : "value" }, Update : map [string ]string {"bar-key" : "value" }},
101+ "key_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.kms_key_id}` },
102+ "password" : acctest.Representation {RepType : acctest .Required , Create : `bEStrO0nG_1` },
103+ "private_ip" : acctest.Representation {RepType : acctest .Optional , Create : `10.0.1.78` },
104+ "connection_string" : acctest.Representation {RepType : acctest .Required , Create : `jdbc:sqlserver://127.0.0.1:1433` },
105+ "username" : acctest.Representation {RepType : acctest .Required , Create : `admin` },
106+ "subnet_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.test_subnet_id}` },
107+ "vault_id" : acctest.Representation {RepType : acctest .Optional , Create : `${var.vault_id}` },
108+ }
74109)
75110
76111// issue-routing-tag: golden_gate/default
@@ -112,7 +147,7 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) {
112147 acctest .ResourceTest (t , testAccCheckGoldenGateConnectionDestroy , []resource.TestStep {
113148 // verify Create
114149 {
115- Config : config + compartmentIdVariableStr + testDeploymentIdVariableStr +
150+ Config : config + compartmentIdVariableStr + testDeploymentIdVariableStr + testSubnetIdVariableStr + testVaultIdVariableStr + testKeyIdVariableStr +
116151 acctest .GenerateResourceFromRepresentationMap ("oci_golden_gate_connection" , "test_connection" , acctest .Required , acctest .Create ,
117152 acctest .RepresentationCopyWithNewProperties (GoldenGateConnectionRepresentation , map [string ]interface {}{
118153 "deployment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.test_deployment_id}` },
@@ -137,6 +172,92 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) {
137172 {
138173 Config : config + compartmentIdVariableStr ,
139174 },
175+ // verify Create - Postgresql
176+ {
177+ Config : config + compartmentIdVariableStr + testSubnetIdVariableStr + testVaultIdVariableStr + testKeyIdVariableStr +
178+ acctest .GenerateResourceFromRepresentationMap ("oci_golden_gate_connection" , "test_connection" , acctest .Required , acctest .Create , PostgresqlConnectionRepresentation ),
179+ Check : acctest .ComposeAggregateTestCheckFuncWrapper (
180+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
181+ resource .TestCheckResourceAttr (resourceName , "connection_type" , "POSTGRESQL" ),
182+ resource .TestCheckResourceAttr (resourceName , "database_name" , "TF_PostgresqlDB" ),
183+ resource .TestCheckResourceAttr (resourceName , "display_name" , "Postgresql_TFtest" ),
184+ resource .TestCheckResourceAttr (resourceName , "host" , "10.0.0.127" ),
185+ resource .TestCheckResourceAttr (resourceName , "password" , "bEStrO0nG_1" ),
186+ resource .TestCheckResourceAttr (resourceName , "port" , "12" ),
187+ resource .TestCheckResourceAttr (resourceName , "username" , "admin" ),
188+ resource .TestCheckResourceAttrSet (resourceName , "security_protocol" ),
189+ resource .TestCheckResourceAttrSet (resourceName , "state" ),
190+ resource .TestCheckResourceAttr (resourceName , "technology_type" , "POSTGRESQL_SERVER" ),
191+ resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
192+ resource .TestCheckResourceAttrSet (resourceName , "time_updated" ),
193+
194+ func (s * terraform.State ) (err error ) {
195+ resId , err = acctest .FromInstanceState (s , resourceName , "id" )
196+ return err
197+ },
198+ ),
199+ },
200+ // verify Create with optionals - Postgresql
201+ {
202+ Config : config + compartmentIdVariableStr + testSubnetIdVariableStr + testVaultIdVariableStr + testKeyIdVariableStr +
203+ acctest .GenerateResourceFromRepresentationMap ("oci_golden_gate_connection" , "test_connection" , acctest .Optional , acctest .Create , PostgresqlConnectionRepresentation ),
204+ Check : acctest .ComposeAggregateTestCheckFuncWrapper (
205+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
206+ resource .TestCheckResourceAttr (resourceName , "connection_type" , "POSTGRESQL" ),
207+ resource .TestCheckResourceAttr (resourceName , "database_name" , "TF_PostgresqlDB" ),
208+ resource .TestCheckResourceAttr (resourceName , "description" , "description" ),
209+ resource .TestCheckResourceAttr (resourceName , "display_name" , "Postgresql_TFtest" ),
210+ resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
211+ resource .TestCheckResourceAttrSet (resourceName , "key_id" ),
212+ resource .TestCheckResourceAttr (resourceName , "host" , "10.0.0.127" ),
213+ resource .TestCheckResourceAttr (resourceName , "password" , "bEStrO0nG_1" ),
214+ resource .TestCheckResourceAttrSet (resourceName , "private_ip" ),
215+ resource .TestCheckResourceAttr (resourceName , "port" , "12" ),
216+ resource .TestCheckResourceAttrSet (resourceName , "security_protocol" ),
217+ resource .TestCheckResourceAttrSet (resourceName , "state" ),
218+ resource .TestCheckResourceAttr (resourceName , "subnet_id" , testSubnetId ),
219+ resource .TestCheckResourceAttr (resourceName , "technology_type" , "POSTGRESQL_SERVER" ),
220+ resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
221+ resource .TestCheckResourceAttrSet (resourceName , "time_updated" ),
222+ resource .TestCheckResourceAttr (resourceName , "username" , "admin" ),
223+ resource .TestCheckResourceAttrSet (resourceName , "vault_id" ),
224+
225+ func (s * terraform.State ) (err error ) {
226+ resId , err = acctest .FromInstanceState (s , resourceName , "id" )
227+ return err
228+ },
229+ ),
230+ },
231+ // delete before next Create
232+ {
233+ Config : config + compartmentIdVariableStr ,
234+ },
235+ // verify Create - AzureSynapse
236+ {
237+ Config : config + compartmentIdVariableStr + testSubnetIdVariableStr + testVaultIdVariableStr + testKeyIdVariableStr +
238+ acctest .GenerateResourceFromRepresentationMap ("oci_golden_gate_connection" , "test_connection" , acctest .Required , acctest .Create , AzureSynapseConnectionRepresentation ),
239+ Check : acctest .ComposeAggregateTestCheckFuncWrapper (
240+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
241+ resource .TestCheckResourceAttr (resourceName , "connection_string" , "jdbc:sqlserver://127.0.0.1:1433" ),
242+ resource .TestCheckResourceAttr (resourceName , "connection_type" , "AZURE_SYNAPSE_ANALYTICS" ),
243+ resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
244+ resource .TestCheckResourceAttr (resourceName , "password" , "bEStrO0nG_1" ),
245+ resource .TestCheckResourceAttr (resourceName , "username" , "admin" ),
246+ resource .TestCheckResourceAttrSet (resourceName , "state" ),
247+ resource .TestCheckResourceAttr (resourceName , "technology_type" , "AZURE_SYNAPSE_ANALYTICS" ),
248+ resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
249+ resource .TestCheckResourceAttrSet (resourceName , "time_updated" ),
250+
251+ func (s * terraform.State ) (err error ) {
252+ resId , err = acctest .FromInstanceState (s , resourceName , "id" )
253+ return err
254+ },
255+ ),
256+ },
257+ // delete before next Create
258+ {
259+ Config : config + compartmentIdVariableStr ,
260+ },
140261 // verify Create with optionals
141262 {
142263 Config : config + compartmentIdVariableStr + testVaultIdVariableStr + testSubnetIdVariableStr + testKeyIdVariableStr + testDeploymentIdVariableStr +
@@ -167,7 +288,6 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) {
167288 },
168289 ),
169290 },
170-
171291 // verify Update to the compartment (the compartment will be switched back in the next step)
172292 {
173293 Config : config + compartmentIdVariableStr + compartmentIdUVariableStr + testSubnetIdVariableStr + testVaultIdVariableStr + testKeyIdVariableStr + testDeploymentIdVariableStr +
@@ -216,7 +336,6 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) {
216336 resource .TestCheckResourceAttrSet (resourceName , "id" ),
217337 resource .TestCheckResourceAttrSet (resourceName , "time_created" ),
218338 resource .TestCheckResourceAttrSet (resourceName , "time_updated" ),
219-
220339 resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
221340 resource .TestCheckResourceAttr (resourceName , "connection_type" , "GOLDENGATE" ),
222341 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName2" ),
@@ -291,13 +410,17 @@ func TestGoldenGateConnectionResource_basic(t *testing.T) {
291410 ImportState : true ,
292411 ImportStateVerify : true ,
293412 ImportStateVerifyIgnore : []string {
413+ "account_key" ,
414+ "client_secret" ,
294415 "consumer_properties" ,
295416 "key_store" ,
296417 "key_store_password" ,
297418 "password" ,
298419 "private_key_file" ,
420+ "private_key_passphrase" ,
299421 "producer_properties" ,
300422 "public_key_fingerprint" ,
423+ "sas_token" ,
301424 "ssl_ca" ,
302425 "ssl_cert" ,
303426 "ssl_crl" ,
0 commit comments