Skip to content

Commit 89300b9

Browse files
siem-agentsrinioci
authored andcommitted
Bugfix - fix unified_agent_configuration param
1 parent 805594e commit 89300b9

File tree

10 files changed

+120
-219
lines changed

10 files changed

+120
-219
lines changed

examples/logging/identity/identity.tf

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,4 @@ variable "log_group_freeform_tags" {
1111
default = {
1212
"Department" = "Finance"
1313
}
14-
}
15-
16-
variable "tag_namespace_description" {
17-
default = "Just a test"
18-
}
19-
20-
variable "tag_namespace_name" {
21-
default = "tf-testexamples-tag-namespace"
22-
}
23-
24-
resource "oci_identity_tag_namespace" "tag-namespace1" {
25-
#Required
26-
compartment_id = var.compartment_id
27-
description = var.tag_namespace_description
28-
name = var.tag_namespace_name
29-
}
30-
31-
resource "oci_identity_tag" "tag1" {
32-
#Required
33-
description = "tf example tag"
34-
name = "tf-example-tag"
35-
tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id
36-
}
37-
38-
resource "oci_identity_tag" "tag2" {
39-
#Required
40-
description = "tf example tag 2"
41-
name = "tf-example-tag-2"
42-
tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id
43-
}
44-
45-
output "tag_namespace1_name" {
46-
value = oci_identity_tag_namespace.tag-namespace1.name
47-
}
48-
output "tag1_name" {
49-
value = oci_identity_tag.tag1.name
50-
}
51-
output "tag2_name" {
52-
value = oci_identity_tag.tag2.name
5314
}

examples/logging/log/log.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ variable "test_log_group_id" {}
5757
variable "test_log_name" {
5858
default = "tf-exampleLog"
5959
}
60-
variable "tag_namespace1_name" {}
61-
variable "tag2_name" {}
60+
6261

6362
resource "oci_logging_log" "test_log" {
6463
#Required
@@ -84,9 +83,6 @@ resource "oci_logging_log" "test_log" {
8483
compartment_id = "ocid1.compartment.oc1..aaaaaaaa4rv5j2vzbrwaztnzvtu7kgswtigms4llcbylelylsqt2l3kl7gaa"
8584
}*/
8685

87-
defined_tags = {
88-
"${var.tag_namespace1_name}.${var.tag2_name}" = var.defined_tags_value
89-
}
9086
freeform_tags = var.freeform_tags_value
9187
is_enabled = "false"
9288
retention_duration = "30"

examples/logging/log_agent_configuration/log_agent_configuration.tf

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
22
// Licensed under the Mozilla Public License v2.0
33

4+
45
variable "compartment_id" {}
56

67
variable "unified_agent_configuration_defined_tags_value" {
@@ -174,8 +175,7 @@ variable "unified_agent_configuration_state" {
174175
variable "log_group_defined_tags_value" {
175176
default = "value2"
176177
}
177-
variable "tag_namespace1_name" {}
178-
variable "tag1_name" {}
178+
179179
variable "test_log_group_id" {}
180180
variable "test_log_id" {}
181181

@@ -238,10 +238,6 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
238238
}
239239
}
240240

241-
#Optional
242-
defined_tags = {
243-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
244-
}
245241
description = var.unified_agent_configuration_description
246242
display_name = var.unified_agent_configuration_display_name
247243
freeform_tags = var.unified_agent_configuration_freeform_tags
@@ -330,9 +326,6 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
330326
}
331327

332328
#Optional
333-
defined_tags = {
334-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
335-
}
336329
description = var.unified_agent_configuration_description
337330
display_name = "test_unified_agent_configuration_1"
338331
freeform_tags = var.unified_agent_configuration_freeform_tags
@@ -374,7 +367,7 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
374367
source {
375368
name = "kubernetes_source"
376369
scrape_targets {
377-
k8s_namespace = "kube_system"
370+
k8s_namespace = "kube-system"
378371
resource_group = "tf-test-resource-group"
379372
resource_type = "PODS"
380373
service_name = "kubernetes"
@@ -390,9 +383,6 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
390383
}
391384

392385
#Optional
393-
defined_tags = {
394-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
395-
}
396386
description = var.unified_agent_configuration_description
397387
display_name = "test_unified_agent_configuration_monitoring_KUBERNETES"
398388
freeform_tags = var.unified_agent_configuration_freeform_tags
@@ -463,9 +453,6 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
463453
}
464454

465455
#Optional
466-
defined_tags = {
467-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
468-
}
469456
description = var.unified_agent_configuration_description
470457
display_name = "test_unified_agent_configuration_monitoring_TAIL"
471458
freeform_tags = var.unified_agent_configuration_freeform_tags
@@ -510,9 +497,6 @@ resource "oci_logging_unified_agent_configuration" "test_unified_agent_configura
510497
}
511498

512499
#Optional
513-
defined_tags = {
514-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
515-
}
516500
description = var.unified_agent_configuration_description
517501
display_name = "test_unified_agent_configuration_monitoring_URL"
518502
freeform_tags = var.unified_agent_configuration_freeform_tags

examples/logging/log_group/log_group.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ variable "freeform_tags_value" {
1818
}
1919
}
2020

21-
variable "tag_namespace1_name" {}
22-
variable "tag2_name" {}
23-
2421
variable "compartment_id" {}
2522

2623
variable "log_group_name" {
@@ -34,9 +31,7 @@ resource "oci_logging_log_group" "test_log_group" {
3431

3532
#Optional
3633
description = "description"
37-
defined_tags = {
38-
"${var.tag_namespace1_name}.${var.tag2_name}" = var.defined_tags_value
39-
}
34+
4035
freeform_tags = var.freeform_tags_value
4136

4237
lifecycle {

examples/logging/log_rule/log_rule.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11

22
variable "compartment_id" {}
3-
variable "tag_namespace1_name" {}
4-
variable "tag1_name" {}
53

64
variable "defined_tags_value" {
75
default = "defined_tags_value"
@@ -21,9 +19,6 @@ resource "oci_logging_log" "test_log" {
2119
resource "oci_logging_log_rule" "test_log_rule" {
2220
compartment_id = var.compartment_id
2321
custom_log_id = oci_logging_log.test_log.id
24-
defined_tags = {
25-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.defined_tags_value
26-
}
2722
description = "description2"
2823
display_name = "logRuleTFExampleName"
2924
freeform_tags = {

examples/logging/log_saved_search/log_saved_search.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ variable "log_group_defined_tags_value" {
1313
default = "tf-value-group"
1414
}
1515
variable "compartment_id" {}
16-
variable "tag_namespace1_name" {}
17-
variable "tag1_name" {}
1816
variable "test_log_saved_search_name" {
1917
default = "tf-exampleLogSavedSearch"
2018
}
@@ -26,9 +24,6 @@ resource "oci_logging_log_saved_search" "test_log_saved_search" {
2624
query = "exampleQuery"
2725

2826
#Optional
29-
defined_tags = {
30-
"${var.tag_namespace1_name}.${var.tag1_name}" = var.log_group_defined_tags_value
31-
}
3227
description = "description"
3328

3429
freeform_tags = var.log_saved_search_freeform_tags

examples/logging/main.tf

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
locals {
88
region = "us-phoenix-1"
99
tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa4s2hncj4oaulmf5tz4yfeska6fya4gkd5jsg3fmlgq7pprgr7wiq"
10-
user_ocid = "ocid1.user.oc1..aaaaaaaa5mxx5f6ltt5w6soekhzetsymtgntbjijmikyc4kqpbau2xfwnsva"
11-
fingerprint = "1e:84:e8:12:08:55:af:2e:51:5e:2a:57:41:ab:fd:c9"
12-
private_key_path = "/Users/shxi/.oci/oci_api_key.pem"
10+
user_ocid = "ocid1.user.oc1..aaaaaaaark6yo7jgevogxohlgerphpr6lreunmmsovjdkhmujnuj2urix5aq"
11+
fingerprint = "16:9a:cf:f4:78:3f:ba:fd:67:fc:74:30:72:e8:e7:11"
12+
private_key_path = "/Users/zhenyao/.oci/oci_api_key.pem"
1313
}
14+
1415
module "identity" {
1516
source = "./identity"
1617
compartment_id = var.compartment_ocid
@@ -19,29 +20,21 @@ module "identity" {
1920
module "log_group" {
2021
source = "./log_group"
2122
compartment_id = var.compartment_ocid
22-
tag2_name = module.identity.tag2_name
23-
tag_namespace1_name = module.identity.tag_namespace1_name
2423
}
2524

2625
module "log" {
2726
source = "./log"
2827
test_log_group_id = module.log_group.test_log_group_id
29-
tag2_name = module.identity.tag2_name
30-
tag_namespace1_name = module.identity.tag_namespace1_name
3128
}
3229

3330
module "log_saved_search" {
3431
source = "./log_saved_search"
3532
compartment_id = var.compartment_ocid
36-
tag1_name = module.identity.tag1_name
37-
tag_namespace1_name = module.identity.tag_namespace1_name
3833
}
3934

4035
module "log_agent_configuration" {
4136
source = "./log_agent_configuration"
4237
compartment_id = var.compartment_ocid
43-
tag1_name = module.identity.tag1_name
44-
tag_namespace1_name = module.identity.tag_namespace1_name
4538
test_log_id = module.log.test_log_id
4639
test_log_group_id = module.log_group.test_log_group_id
47-
}
40+
}

examples/logging/provider.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77

88
// These variables would commonly be defined as environment variables or sourced in a .env file
99
variable "tenancy_ocid" {
10+
default = "ocid1.tenancy.oc1..aaaaaaaa4s2hncj4oaulmf5tz4yfeska6fya4gkd5jsg3fmlgq7pprgr7wiq"
1011
}
1112

1213
variable "user_ocid" {
14+
default = "ocid1.user.oc1..aaaaaaaark6yo7jgevogxohlgerphpr6lreunmmsovjdkhmujnuj2urix5aq"
1315
}
1416

1517
variable "fingerprint" {
18+
default = "16:9a:cf:f4:78:3f:ba:fd:67:fc:74:30:72:e8:e7:11"
1619
}
1720

1821
variable "private_key_path" {
22+
default = "/Users/zhenyao/.oci/oci_api_key.pem"
1923
}
2024

2125
variable "compartment_ocid" {
26+
default = "ocid1.compartment.oc1..aaaaaaaajdgiuoxrwem3326sihqitq3rf62hg4bq255hzchqwszx2xz4zega"
2227
}
2328

2429
variable "region" {

0 commit comments

Comments
 (0)