Skip to content

Commit 7f19c91

Browse files
lm-oraclesagarp337
authored andcommitted
Added - Support for Connections R6
1 parent 0b79dbe commit 7f19c91

File tree

8 files changed

+1597
-144
lines changed

8 files changed

+1597
-144
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
variable "tenancy_ocid" {}
2+
variable "user_ocid" {}
3+
variable "deployment_ocid" {}
4+
variable "fingerprint" {}
5+
variable "private_key_path" {}
6+
variable "compartment_id" {}
7+
variable "region" {}
8+
9+
variable "description" {
10+
default = "Created as example for TERSI-6831 Connections R6"
11+
}
12+
variable "freeform_tags" {
13+
default = { "bar-key" = "value" }
14+
}
15+
variable "connection_type" {
16+
default = "DATABRICKS"
17+
}
18+
variable "display_name" {
19+
default = "Databricks_TerraformTest"
20+
}
21+
variable "technology_type" {
22+
default = "DATABRICKS"
23+
}
24+
variable "connection_url"{
25+
default = "jdbc:databricks://adb-33934.4.azuredatabricks.net:443/default;transportMode=http;ssl=1;httpPath=sql/protocolv1/o/3393########44/0##3-7-hlrb"
26+
}
27+
variable "authentication_type" {
28+
default = "PERSONAL_ACCESS_TOKEN"
29+
}
30+
31+
variable "password" {
32+
default = "bEStrO0nG_1"
33+
}
34+
35+
36+
provider "oci" {
37+
tenancy_ocid = var.tenancy_ocid
38+
user_ocid = var.user_ocid
39+
fingerprint = var.fingerprint
40+
private_key_path = var.private_key_path
41+
region = var.region
42+
}
43+
resource "oci_golden_gate_connection" "test_connection"{
44+
#Required
45+
compartment_id = var.compartment_id
46+
connection_type = var.connection_type
47+
display_name = var.display_name
48+
connection_url = var.connection_url
49+
authentication_type = var.authentication_type
50+
51+
#Required for Postgresql connection_type
52+
technology_type = var.technology_type
53+
password = var.password
54+
55+
#Optional
56+
description = var.description
57+
freeform_tags = var.freeform_tags
58+
}

internal/integrationtest/golden_gate_connection_test.go

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ var (
112112
oci_golden_gate.ConnectionTypePostgresql,
113113
oci_golden_gate.ConnectionTypeRedis,
114114
oci_golden_gate.ConnectionTypeSnowflake,
115+
oci_golden_gate.ConnectionTypeDatabricks,
116+
oci_golden_gate.ConnectionTypeGooglePubsub,
117+
oci_golden_gate.ConnectionTypeMicrosoftFabric,
115118
}
116119

117120
CommonConnectionRepresentation = map[string]interface{}{
@@ -422,8 +425,12 @@ var (
422425
representation: map[string]interface{}{
423426
"connection_string": acctest.Representation{RepType: acctest.Required, Create: `mongodb://10.0.0.1:9000`,
424427
Update: `mongodb://10.0.0.1:9001`},
425-
"username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`},
426-
"password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`},
428+
"username": acctest.Representation{RepType: acctest.Required, Create: `username`, Update: `newUsername`},
429+
"password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: ``},
430+
"security_protocol": acctest.Representation{RepType: acctest.Optional, Update: string(oci_golden_gate.MongoDbConnectionSecurityProtocolTls)},
431+
"does_use_secret_ids": acctest.Representation{RepType: acctest.Optional, Update: `true`},
432+
"password_secret_id": acctest.Representation{RepType: acctest.Optional, Update: `${var.new_password_secret_id}`},
433+
"tls_ca_file": acctest.Representation{RepType: acctest.Optional, Update: `LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNTakNDQWZHZ0F3SUJBZ0lKQUlkQjcyaUp0NisxTUFvR0NDcUdTTTQ5QkFNQ01JR0JNUXN3Q1FZRFZRUUcKRXdKVlV6RUxNQWtHQTFVRUNBd0NWVk14RERBS0JnTlZCQWNNQTA1WlF6RVBNQTBHQTFVRUNnd0dUM0poWTJ4bApNUXd3Q2dZRFZRUUxEQU52WTJreER6QU5CZ05WQkFNTUJtTmhUbUZ0WlRFbk1DVUdDU3FHU0liM0RRRUpBUllZCmVuTnZiSFF1YUc5eWRtRjBhRUJ2Y21GamJHVXVZMjl0TUI0WERUSXpNRE15TWpJek5EVXhPRm9YRFRJMU1USXgKTmpJek5EVXhPRm93Z1lFeEN6QUpCZ05WQkFZVEFsVlRNUXN3Q1FZRFZRUUlEQUpWVXpFTU1Bb0dBMVVFQnd3RApUbGxETVE4d0RRWURWUVFLREFaUGNtRmpiR1V4RERBS0JnTlZCQXNNQTI5amFURVBNQTBHQTFVRUF3d0dZMkZPCllXMWxNU2N3SlFZSktvWklodmNOQVFrQkZoaDZjMjlzZEM1b2IzSjJZWFJvUUc5eVlXTnNaUzVqYjIwd1dUQVQKQmdjcWhrak9QUUlCQmdncWhrak9QUU1CQndOQ0FBU3RCWVRWNU1BUGlXWEJUaE9qS25MaGVTVDVvaU1PK1FhOAphSkNucXEvVXNNT2d6YWNXeDFzc3hmUTJtc1Q0N1pJcUpvNnh6RS9yR0thc2RUM2U2RHcvbzFBd1RqQWRCZ05WCkhRNEVGZ1FVVG5UQkF1VXhWK254TjZXZ0lsbnRwZU95cmo0d0h3WURWUjBqQkJnd0ZvQVVUblRCQXVVeFYrbngKTjZXZ0lsbnRwZU95cmo0d0RBWURWUjBUQkFVd0F3RUIvekFLQmdncWhrak9QUVFEQWdOSEFEQkVBaUFwUmxsLwpLeGk4RnJYSDVWVDE2czJIVVRGdC9Ddlh0SzZjamhabHZBTG43Z0lnSGlnTEk2QjVLdlFQOGFONDA4dW0xQzhLCnROZGh4TWZLdGFMWEJwbVZraGc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K`},
427434
},
428435
},
429436

@@ -516,6 +523,54 @@ var (
516523
"password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`},
517524
},
518525
},
526+
527+
// Databricks
528+
{connectionType: oci_golden_gate.ConnectionTypeDatabricks, technologyType: oci_golden_gate.TechnologyTypeDatabricks,
529+
representation: map[string]interface{}{
530+
"connection_url": acctest.Representation{RepType: acctest.Required, Create: `jdbc:databricks://adb-33934.4.azuredatabricks.net:443/default;transportMode=http;ssl=1;httpPath=sql/protocolv1/o/3393########44/0##3-7-hlrb`,
531+
Update: `jdbc:databricks://adb-33934.4.azuredatabricks.net:443/default;transportMode=http;ssl=1;httpPath=sql/protocolv1/o/3393########44/0##3-7-hlrb2`},
532+
"authentication_type": acctest.Representation{RepType: acctest.Required, Create: string(oci_golden_gate.DatabricksConnectionAuthenticationTypePersonalAccessToken)},
533+
"password": acctest.Representation{RepType: acctest.Required, Create: `${var.password}`, Update: `${var.new_password}`},
534+
},
535+
},
536+
537+
// GooglePubsub
538+
{connectionType: oci_golden_gate.ConnectionTypeGooglePubsub, technologyType: oci_golden_gate.TechnologyTypeGooglePubsub,
539+
representation: map[string]interface{}{
540+
"service_account_key_file": acctest.Representation{RepType: acctest.Required,
541+
Create: b64.StdEncoding.EncodeToString([]byte(
542+
"{\n \"type\": \"service_account\",\n" +
543+
" \"project_id\": \"your-project-id\",\n" +
544+
" \"private_key_id\": \"your-private-key-id\",\n" +
545+
" \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nYour_Private_Key_Here\\n-----END PRIVATE KEY-----\",\n" +
546+
" \"client_email\": \"your-service-account-email@your-project-id.iam.gserviceaccount.com\",\n" +
547+
" \"client_id\": \"your-client-id1\",\n" +
548+
" \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n" +
549+
" \"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n" +
550+
" \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n" +
551+
" \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email%40your-project-id.iam.gserviceaccount.com\"\n}\n")),
552+
Update: b64.StdEncoding.EncodeToString([]byte(
553+
"{\n \"type\": \"service_account\",\n" +
554+
" \"project_id\": \"your-project-id\",\n" +
555+
" \"private_key_id\": \"your-private-key-id\",\n" +
556+
" \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nYour_Private_Key_Here\\n-----END PRIVATE KEY-----\",\n" +
557+
" \"client_email\": \"your-service-account-email@your-project-id.iam.gserviceaccount.com\",\n" +
558+
" \"client_id\": \"your-client-id2\",\n" +
559+
" \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n" +
560+
" \"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n" +
561+
" \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n" +
562+
" \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email%40your-project-id.iam.gserviceaccount.com\"\n}\n"))},
563+
},
564+
},
565+
566+
// MicrosoftFabric
567+
{connectionType: oci_golden_gate.ConnectionTypeMicrosoftFabric, technologyType: oci_golden_gate.TechnologyTypeMicrosoftFabricLakehouse,
568+
representation: map[string]interface{}{
569+
"tenant_id": acctest.Representation{RepType: acctest.Required, Create: `14593954-d337-4a61-a364-9f758c64f97f`},
570+
"client_id": acctest.Representation{RepType: acctest.Required, Create: `06ecaabf-8b80-4ec8-a0ec-20cbf463703d`,
571+
Update: `06ecaabf-8b80-4ec8-a0ec-20cbf463703f`},
572+
},
573+
},
519574
}
520575

521576
ExcludedFields = []string{
@@ -543,6 +598,7 @@ var (
543598
"service_account_key_file",
544599
"is_lock_override",
545600
"trigger_refresh",
601+
"tls_ca_file",
546602
}
547603
)
548604

0 commit comments

Comments
 (0)