Skip to content

Commit 91759e8

Browse files
Ganesh Radhakrishnansagarp337
authored andcommitted
Added - Support for new service Data Intelligence Foundation
1 parent 36b9c6d commit 91759e8

16 files changed

+5602
-0
lines changed

examples/dif/stack.tf

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {
5+
}
6+
7+
variable "user_ocid" {
8+
}
9+
10+
variable "fingerprint" {
11+
}
12+
13+
variable "private_key_path" {
14+
}
15+
16+
variable "region" {
17+
}
18+
19+
provider "oci" {
20+
tenancy_ocid = var.tenancy_ocid
21+
user_ocid = var.user_ocid
22+
fingerprint = var.fingerprint
23+
private_key_path = var.private_key_path
24+
region = var.region
25+
}
26+
27+
variable "compartment_id" { }
28+
29+
variable "stack_display_name" {
30+
default = "testtfstack"
31+
}
32+
33+
variable "stack_freeform_tags" {
34+
default = { "Division" = "DEV" }
35+
}
36+
37+
variable "stack_adb_is_public" {
38+
default = false
39+
}
40+
41+
variable "password_secret_id" { }
42+
variable "dataflow_file_uri" { }
43+
variable "stack_subnet_id" { }
44+
45+
resource "oci_dif_stack" "test_stack" {
46+
#Required
47+
compartment_id = var.compartment_id
48+
display_name = var.stack_display_name
49+
50+
services = [
51+
"OBJECTSTORAGE", "ADB", "DATAFLOW"
52+
]
53+
54+
stack_templates = [
55+
"DATALAKE", "DATATRANSFORMATION"
56+
]
57+
58+
objectstorage {
59+
instance_id = "testLogBucket1"
60+
object_versioning = "ENABLED"
61+
storage_tier = "STANDARD"
62+
}
63+
64+
adb {
65+
instance_id = "testadb1"
66+
db_workload = "DW"
67+
ecpu = 2
68+
data_storage_size_in_tbs = 1
69+
admin_password_id = var.password_secret_id
70+
is_public = var.stack_adb_is_public
71+
subnet_id = var.stack_subnet_id
72+
db_version = "19c"
73+
}
74+
75+
dataflow {
76+
instance_id = "testApp"
77+
log_bucket_instance_id = "testLogBucket1"
78+
num_executors = "3"
79+
spark_version = "3.5.0"
80+
connections {
81+
connection_details {
82+
dif_dependencies {
83+
service_instance_id = "testadb1"
84+
service_type = "ADB"
85+
}
86+
domain_names = ["custpvtsubnet.oraclevcn.com"]
87+
}
88+
subnet_id = var.stack_subnet_id
89+
}
90+
driver_shape = "VM.Standard.E5.Flex"
91+
driver_shape_config {
92+
memory_in_gbs = "16"
93+
ocpus = "1"
94+
}
95+
executor_shape = "VM.Standard.E5.Flex"
96+
executor_shape_config {
97+
memory_in_gbs = "16"
98+
ocpus = "1"
99+
}
100+
execute = var.dataflow_file_uri
101+
}
102+
objectstorage {
103+
instance_id = "testBucket2"
104+
object_versioning = "DISABLED"
105+
storage_tier = "STANDARD"
106+
}
107+
108+
subnet_id = var.stack_subnet_id
109+
110+
deploy_artifacts_trigger = 1
111+
add_service_trigger = 1
112+
113+
//ignore so that this does not cause perpetual diff
114+
lifecycle {
115+
ignore_changes = [
116+
# Ignore service-generated metadata and tags
117+
defined_tags,
118+
freeform_tags,
119+
system_tags,
120+
service_details,
121+
time_created,
122+
time_updated,
123+
]
124+
}
125+
}

internal/client/dif_clients.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package client
5+
6+
import (
7+
oci_dif "github.com/oracle/oci-go-sdk/v65/dif"
8+
9+
oci_common "github.com/oracle/oci-go-sdk/v65/common"
10+
)
11+
12+
func init() {
13+
RegisterOracleClient("oci_dif.StackClient", &OracleClient{InitClientFn: initDifStackClient})
14+
}
15+
16+
func initDifStackClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) {
17+
client, err := oci_dif.NewStackClientWithConfigurationProvider(configProvider)
18+
if err != nil {
19+
return nil, err
20+
}
21+
err = configureClient(&client.BaseClient)
22+
if err != nil {
23+
return nil, err
24+
}
25+
26+
if serviceClientOverrides.HostUrlOverride != "" {
27+
client.Host = serviceClientOverrides.HostUrlOverride
28+
}
29+
return &client, nil
30+
}
31+
32+
func (m *OracleClients) StackClient() *oci_dif.StackClient {
33+
return m.GetClient("oci_dif.StackClient").(*oci_dif.StackClient)
34+
}

0 commit comments

Comments
 (0)