Skip to content

Commit 02dce93

Browse files
authored
Merge pull request #57 from oracle-devrel/iopanait-develop2
added new oci solutions for monitoring
2 parents 1f49a44 + 01f0332 commit 02dce93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3913
-19
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# # Copyright © 2022, Oracle and/or its affiliates.
2+
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
resource "oci_database_autonomous_database" "adw" {
5+
for_each = {
6+
for k,v in var.adw_params : k => v if v.compartment_id != ""
7+
}
8+
admin_password = each.value.database_admin_password
9+
compartment_id = each.value.compartment_id
10+
cpu_core_count = each.value.adw_cpu_core_count
11+
data_storage_size_in_tbs = each.value.adw_size_in_tbs
12+
db_name = each.value.adw_db_name
13+
display_name = each.value.adw_db_name
14+
db_workload = each.value.adw_db_workload
15+
db_version = each.value.adw_db_version
16+
is_auto_scaling_enabled = each.value.adw_enable_auto_scaling
17+
is_free_tier = each.value.adw_is_free_tier
18+
license_model = each.value.adw_license_model
19+
data_safe_status = each.value.data_safe_status
20+
subnet_id = each.value.subnet_id
21+
nsg_ids = each.value.nsg_ids
22+
defined_tags = each.value.defined_tags
23+
}
24+
25+
resource "oci_database_autonomous_database_wallet" "autonomous_data_warehouse_wallet" {
26+
for_each = var.adw_params
27+
autonomous_database_id = oci_database_autonomous_database.adw[each.key].id
28+
password = each.value.database_wallet_password
29+
base64_encode_content = true
30+
}
31+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# # Copyright © 2022, Oracle and/or its affiliates.
2+
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
output "ADW_Service_Console_URL" {
5+
value = join(", ", [for x in oci_database_autonomous_database.adw : x.service_console_url])
6+
}
7+
8+
output "adw" {
9+
value = {
10+
for adw in oci_database_autonomous_database.adw:
11+
adw.display_name => adw.id
12+
}
13+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# # Copyright © 2022, Oracle and/or its affiliates.
2+
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "adw_params" {
5+
type = map(object({
6+
compartment_id = string
7+
adw_cpu_core_count = number
8+
adw_size_in_tbs = number
9+
adw_db_name = string
10+
adw_db_workload = string
11+
adw_db_version = string
12+
adw_enable_auto_scaling = bool
13+
adw_is_free_tier = bool
14+
adw_license_model = string
15+
data_safe_status = string
16+
database_admin_password = string
17+
database_wallet_password = string
18+
subnet_id = string
19+
nsg_ids = list(string)
20+
defined_tags = map(string)
21+
}))
22+
}
23+
24+
25+
26+
27+
28+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Copyright © 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
resource "oci_data_safe_data_safe_private_endpoint" "this" {
5+
for_each = var.oci_data_safe_private_endpoint_params
6+
compartment_id = each.value.compartment_id
7+
display_name = each.value.display_name
8+
subnet_id = each.value.subnet_id
9+
vcn_id = each.value.vcn_id
10+
defined_tags = each.value.defined_tags
11+
description = each.value.description
12+
nsg_ids = each.value.nsg_ids
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Copyright © 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
output "data_safe_private_endpoint" {
5+
value = {for b in oci_data_safe_data_safe_private_endpoint.this:
6+
b.display_name => b.id}
7+
}
8+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Copyright © 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
variable "oci_data_safe_private_endpoint_params" {
5+
type = map(object({
6+
compartment_id = string
7+
display_name = string
8+
description = string
9+
vcn_id = string
10+
subnet_id = string
11+
nsg_ids = list(string)
12+
defined_tags = map(string)
13+
}))
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
data "oci_identity_tenancy" "this" {
5+
tenancy_id = var.tenancy_ocid
6+
}
7+
8+
resource "oci_log_analytics_log_analytics_log_group" "this" {
9+
for_each = var.log_analytics_log_group_params
10+
compartment_id = each.value.compartment_id
11+
display_name = each.value.display_name
12+
namespace = data.oci_identity_tenancy.this.name
13+
}
14+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
output "log_analytics_log_group" {
5+
value = {for sc in oci_log_analytics_log_analytics_log_group.this:
6+
sc.display_name => sc.id}
7+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright © 2022, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "tenancy_ocid" {
5+
type = string
6+
}
7+
8+
variable "log_analytics_log_group_params" {
9+
type = map(object({
10+
compartment_id = string
11+
display_name = string
12+
}))
13+
}
14+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Copyright © 2022, Oracle and/or its affiliates.
2+
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
3+
4+
data "oci_objectstorage_namespace" "this" {
5+
compartment_id = var.tenancy_ocid
6+
}
7+
8+
resource "oci_sch_service_connector" "this" {
9+
for_each = var.srv_connector_params
10+
compartment_id = each.value.compartment_id
11+
display_name = each.value.display_name
12+
state = upper(each.value.state)
13+
source {
14+
kind = lower(each.value.srv_connector_source_kind)
15+
cursor {
16+
kind = lower(each.value.srv_connector_source_kind) == "streaming" ? "streaming" : null
17+
}
18+
dynamic "log_sources" {
19+
iterator = ls
20+
for_each = each.value.log_sources_params
21+
content {
22+
compartment_id = lower(each.value.srv_connector_source_kind) == "logging" ? each.value.compartment_id : null
23+
log_group_id = lower(each.value.srv_connector_source_kind) == "logging" ? ls.value.is_audit == true ? ls.value.log_group_name : var.log_group[ls.value.log_group_name] : null
24+
log_id = lower(each.value.srv_connector_source_kind) == "logging" ? ls.value.is_audit == true ? ls.value.log_name : var.log_id[ls.value.log_name] : null
25+
}
26+
}
27+
stream_id = lower(each.value.srv_connector_source_kind) == "streaming" ? var.streaming[each.value.source_stream_name] : null
28+
}
29+
target {
30+
kind = each.value.srv_connector_target_kind
31+
32+
batch_rollover_size_in_mbs = each.value.srv_connector_target_kind == "objectstorage" ? each.value.obj_batch_rollover_size_in_mbs : null
33+
batch_rollover_time_in_ms = each.value.srv_connector_target_kind == "objectstorage" ? each.value.obj_batch_rollover_time_in_ms : null
34+
bucket = each.value.srv_connector_target_kind == "objectstorage" ? each.value.obj_target_bucket : null
35+
compartment_id = each.value.compartment_id
36+
object_name_prefix = each.value.srv_connector_target_kind == "objectstorage" ? each.value.object_name_prefix : null
37+
function_id = each.value.srv_connector_target_kind == "functions" ? var.functions[each.value.function_name] : null
38+
log_group_id = each.value.srv_connector_target_kind == "loggingAnalytics" ? each.value.target_log_group : null
39+
metric = each.value.srv_connector_target_kind == "monitoring" ? each.value.mon_target_metric : null
40+
metric_namespace = each.value.srv_connector_target_kind == "monitoring" ? each.value.mon_target_metric_namespace : null
41+
namespace = each.value.srv_connector_target_kind == "objectstorage" ? data.oci_objectstorage_namespace.this.namespace : null
42+
stream_id = each.value.srv_connector_target_kind == "streaming" ? var.streaming[each.value.target_stream_name] : null
43+
topic_id = each.value.srv_connector_target_kind == "notifications" ? var.topics[each.value.target_topic_name] : null
44+
enable_formatted_messaging = each.value.srv_connector_target_kind == "notifications" ? var.topics[each.value.enable_formatted_messaging] : null
45+
}
46+
47+
dynamic "tasks" {
48+
iterator = tsk
49+
for_each = each.value.tasks
50+
content {
51+
kind = tsk.value.tasks_kind
52+
batch_size_in_kbs = tsk.value.task_batch_size_in_kbs
53+
batch_time_in_sec = tsk.value.task_batch_time_in_sec
54+
function_id = var.functions[tsk.value.task_function_name]
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)