Skip to content

Commit 3282e43

Browse files
Ryszard MacidlowskiNagendraNigade
authored andcommitted
Added - Support for Stack Monitoring service
1 parent 29cb961 commit 3282e43

File tree

41 files changed

+6298
-0
lines changed

Some content is hidden

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

41 files changed

+6298
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_discovery" {}
11+
12+
13+
provider "oci" {
14+
tenancy_ocid = var.tenancy_ocid
15+
user_ocid = var.user_ocid
16+
fingerprint = var.fingerprint
17+
private_key_path = var.private_key_path
18+
region = var.region
19+
}
20+
21+
22+
resource "oci_stack_monitoring_discovery_job" "test_discovery_job" {
23+
#Required
24+
compartment_id = var.compartment_ocid
25+
discovery_client = "LA_SERVICE"
26+
discovery_type = "ADD"
27+
discovery_details {
28+
#Required
29+
agent_id = var.stack_mon_management_agent_id_discovery
30+
properties {
31+
32+
#Optional
33+
properties_map = {
34+
"admin_server_host" = "somehost.us.oracle.com",
35+
"admin_server_port" = "7001",
36+
"admin_server_protocol" = "t3"
37+
}
38+
}
39+
resource_name = "terraformExample"
40+
resource_type = "WEBLOGIC_DOMAIN"
41+
42+
#Optional
43+
credentials {
44+
#Required
45+
items {
46+
#Required
47+
credential_name = "Sk1YQ3JlZHM="
48+
credential_type = "Sk1YQ3JlZHM="
49+
properties {
50+
51+
#Optional
52+
properties_map = {
53+
"Username" = "d2VibG9naWM=",
54+
"Password" = "d2VibG9naWM="
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
62+
63+
data "oci_stack_monitoring_discovery_job_logs" "test_discovery_job_logs" {
64+
#Required
65+
discovery_job_id = oci_stack_monitoring_discovery_job.test_discovery_job.id
66+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_discovery" {}
11+
12+
13+
provider "oci" {
14+
tenancy_ocid = var.tenancy_ocid
15+
user_ocid = var.user_ocid
16+
fingerprint = var.fingerprint
17+
private_key_path = var.private_key_path
18+
region = var.region
19+
}
20+
21+
22+
resource "oci_stack_monitoring_discovery_job" "test_discovery_job" {
23+
#Required
24+
compartment_id = var.compartment_ocid
25+
discovery_client = "LA_SERVICE"
26+
discovery_type = "ADD"
27+
discovery_details {
28+
#Required
29+
agent_id = var.stack_mon_management_agent_id_discovery
30+
properties {
31+
32+
#Optional
33+
properties_map = {
34+
"admin_server_host" = "somehost.us.oracle.com",
35+
"admin_server_port" = "7001",
36+
"admin_server_protocol" = "t3"
37+
}
38+
}
39+
resource_name = "terraformExample"
40+
resource_type = "WEBLOGIC_DOMAIN"
41+
42+
#Optional
43+
credentials {
44+
#Required
45+
items {
46+
#Required
47+
credential_name = "Sk1YQ3JlZHM="
48+
credential_type = "Sk1YQ3JlZHM="
49+
properties {
50+
51+
#Optional
52+
properties_map = {
53+
"Username" = "d2VibG9naWM=",
54+
"Password" = "d2VibG9naWM="
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
data "oci_stack_monitoring_discovery_jobs" "test_discovery_jobs" {
62+
#Required
63+
compartment_id = var.compartment_ocid
64+
}
65+
66+
data "oci_stack_monitoring_discovery_job" "test_discovery_job" {
67+
#Required
68+
discovery_job_id = oci_stack_monitoring_discovery_job.test_discovery_job.id
69+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_resource1" {}
11+
variable "stack_mon_management_agent_id_resource2" {}
12+
variable "stack_mon_hostname_resource1" {}
13+
variable "stack_mon_hostname_resource2" {}
14+
15+
16+
provider "oci" {
17+
tenancy_ocid = var.tenancy_ocid
18+
user_ocid = var.user_ocid
19+
fingerprint = var.fingerprint
20+
private_key_path = var.private_key_path
21+
region = var.region
22+
}
23+
24+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource1" {
25+
#Required
26+
compartment_id = var.compartment_ocid
27+
name = "terraformExample"
28+
type = "host"
29+
30+
#Optional
31+
display_name = "exampleDisplayName"
32+
host_name = var.stack_mon_hostname_resource1
33+
management_agent_id = var.stack_mon_management_agent_id_resource1
34+
properties {
35+
name = "OS"
36+
value = "Linux"
37+
}
38+
resource_time_zone = "en"
39+
}
40+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource2" {
41+
#Required
42+
compartment_id = var.compartment_ocid
43+
name = "terraformExample2"
44+
type = "host"
45+
46+
#Optional
47+
display_name = "exampleDisplayName2"
48+
host_name = var.stack_mon_hostname_resource2
49+
management_agent_id = var.stack_mon_management_agent_id_resource2
50+
properties {
51+
name = "OS"
52+
value = "Linux"
53+
}
54+
resource_time_zone = "en"
55+
}
56+
57+
resource "oci_stack_monitoring_monitored_resources_associate_monitored_resource" "test_monitored_resources_associate_monitored_resource" {
58+
#Required
59+
association_type = "contains"
60+
compartment_id = var.compartment_ocid
61+
destination_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource2.id
62+
source_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource1.id
63+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_resource1" {}
11+
variable "stack_mon_management_agent_id_resource2" {}
12+
variable "stack_mon_hostname_resource1" {}
13+
variable "stack_mon_hostname_resource2" {}
14+
15+
16+
provider "oci" {
17+
tenancy_ocid = var.tenancy_ocid
18+
user_ocid = var.user_ocid
19+
fingerprint = var.fingerprint
20+
private_key_path = var.private_key_path
21+
region = var.region
22+
}
23+
24+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource" {
25+
#Required
26+
compartment_id = var.compartment_ocid
27+
name = "terraformExample"
28+
type = "host"
29+
30+
#Optional
31+
display_name = "exampleDisplayName"
32+
host_name = var.stack_mon_hostname_resource1
33+
management_agent_id = var.stack_mon_management_agent_id_resource1
34+
properties {
35+
name = "OS"
36+
value = "Linux"
37+
}
38+
resource_time_zone = "en"
39+
}
40+
41+
data "oci_stack_monitoring_monitored_resource" "test_monitored_resource" {
42+
#Required
43+
monitored_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource.id
44+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_resource1" {}
11+
variable "stack_mon_management_agent_id_resource2" {}
12+
variable "stack_mon_hostname_resource1" {}
13+
variable "stack_mon_hostname_resource2" {}
14+
15+
16+
provider "oci" {
17+
tenancy_ocid = var.tenancy_ocid
18+
user_ocid = var.user_ocid
19+
fingerprint = var.fingerprint
20+
private_key_path = var.private_key_path
21+
region = var.region
22+
}
23+
24+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource1" {
25+
#Required
26+
compartment_id = var.compartment_ocid
27+
name = "terraformExample"
28+
type = "host"
29+
30+
#Optional
31+
display_name = "exampleDisplayName"
32+
host_name = var.stack_mon_hostname_resource1
33+
management_agent_id = var.stack_mon_management_agent_id_resource1
34+
properties {
35+
name = "OS"
36+
value = "Linux"
37+
}
38+
resource_time_zone = "en"
39+
}
40+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource2" {
41+
#Required
42+
compartment_id = var.compartment_ocid
43+
name = "terraformExample2"
44+
type = "host"
45+
46+
#Optional
47+
display_name = "exampleDisplayName2"
48+
host_name = var.stack_mon_hostname_resource2
49+
management_agent_id = var.stack_mon_management_agent_id_resource2
50+
properties {
51+
name = "OS"
52+
value = "Linux"
53+
}
54+
resource_time_zone = "en"
55+
}
56+
57+
resource "oci_stack_monitoring_monitored_resources_associate_monitored_resource" "test_monitored_resources_associate_monitored_resource" {
58+
#Required
59+
association_type = "contains"
60+
compartment_id = var.compartment_ocid
61+
destination_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource2.id
62+
source_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource1.id
63+
}
64+
65+
resource "oci_stack_monitoring_monitored_resources_list_member" "test_monitored_resources_list_member" {
66+
#Required
67+
monitored_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource1.id
68+
69+
#Optional
70+
destination_resource_id = oci_stack_monitoring_monitored_resource.test_monitored_resource2.id
71+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_ocid" {}
10+
variable "stack_mon_management_agent_id_resource1" {}
11+
variable "stack_mon_management_agent_id_resource2" {}
12+
variable "stack_mon_hostname_resource1" {}
13+
variable "stack_mon_hostname_resource2" {}
14+
15+
16+
provider "oci" {
17+
tenancy_ocid = var.tenancy_ocid
18+
user_ocid = var.user_ocid
19+
fingerprint = var.fingerprint
20+
private_key_path = var.private_key_path
21+
region = var.region
22+
}
23+
24+
resource "oci_stack_monitoring_monitored_resource" "test_monitored_resource" {
25+
#Required
26+
compartment_id = var.compartment_ocid
27+
name = "terraformExample"
28+
type = "host"
29+
30+
#Optional
31+
display_name = "exampleDisplayName"
32+
host_name = var.stack_mon_hostname_resource1
33+
management_agent_id = var.stack_mon_management_agent_id_resource1
34+
properties {
35+
name = "OS"
36+
value = "Linux"
37+
}
38+
resource_time_zone = "en"
39+
}
40+
41+
resource "oci_stack_monitoring_monitored_resources_search" "test_monitored_resources_search" {
42+
#Required
43+
compartment_id = var.compartment_ocid
44+
45+
#Optional
46+
host_name = var.stack_mon_hostname_resource1
47+
management_agent_id = var.stack_mon_management_agent_id_resource1
48+
name = "terraformExample"
49+
resource_time_zone = "en"
50+
type = "host"
51+
}

0 commit comments

Comments
 (0)