Skip to content

Commit d80b4a5

Browse files
author
Yi Fan
committed
Support resource discovery for monitoring resources
1 parent 085668e commit d80b4a5

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Support for MultiVM-Gen 2 Exadata Cloud at Customer
99
- Support for `dbVersion` field added to Autonomous Database back resource
1010
- Support for patch and patch history in `database_vm_cluster`
11+
- Support resource discovery for `monitoring` resources
1112

1213
## 3.79.0 (June 03, 2020)
1314

oci/export_definitions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
oci_identity "github.com/oracle/oci-go-sdk/identity"
1919
oci_limits "github.com/oracle/oci-go-sdk/limits"
2020
oci_load_balancer "github.com/oracle/oci-go-sdk/loadbalancer"
21+
oci_monitoring "github.com/oracle/oci-go-sdk/monitoring"
2122
oci_nosql "github.com/oracle/oci-go-sdk/nosql"
2223
oci_osmanagement "github.com/oracle/oci-go-sdk/osmanagement"
2324
oci_streaming "github.com/oracle/oci-go-sdk/streaming"
@@ -994,6 +995,17 @@ var exportLoadBalancerRuleSetHints = &TerraformResourceHints{
994995
resourceAbbreviation: "rule_set",
995996
}
996997

998+
var exportMonitoringAlarmHints = &TerraformResourceHints{
999+
resourceClass: "oci_monitoring_alarm",
1000+
datasourceClass: "oci_monitoring_alarms",
1001+
datasourceItemsAttr: "alarms",
1002+
resourceAbbreviation: "alarm",
1003+
requireResourceRefresh: true,
1004+
discoverableLifecycleStates: []string{
1005+
string(oci_monitoring.AlarmLifecycleStateActive),
1006+
},
1007+
}
1008+
9971009
var exportNosqlTableHints = &TerraformResourceHints{
9981010
resourceClass: "oci_nosql_table",
9991011
datasourceClass: "oci_nosql_tables",

oci/export_graphs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var compartmentResourceGraphs = map[string]TerraformResourceGraph{
6060
"functions": functionsResourceGraph,
6161
"health_checks": healthChecksResourceGraph,
6262
"load_balancer": loadBalancerResourceGraph,
63+
"monitoring": monitoringResourceGraph,
6364
"nosql": nosqlResourceGraph,
6465
"object_storage": objectStorageResourceGraph,
6566
"osmanagement": osmanagementResourceGraph,
@@ -462,6 +463,12 @@ var loadBalancerResourceGraph = TerraformResourceGraph{
462463
},
463464
}
464465

466+
var monitoringResourceGraph = TerraformResourceGraph{
467+
"oci_identity_compartment": {
468+
{TerraformResourceHints: exportMonitoringAlarmHints},
469+
},
470+
}
471+
465472
var nosqlResourceGraph = TerraformResourceGraph{
466473
"oci_identity_compartment": {
467474
{TerraformResourceHints: exportNosqlTableHints},

website/docs/guides/resource_discovery.html.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ The generated `.tf` files contain the Terraform configuration with the resources
107107
* `identity` - Discovers identity resources across the entire tenancy
108108
* `limits` - Discovers limits resources across the entire tenancy
109109
* `load_balancer` - Discovers load balancer resources within the specified compartment
110+
* `monitoring` - Discovers monitoring resources within the specified compartment
110111
* `nosql` - Discovers nosql resources within the specified compartment
111112
* `object_storage` - Discovers object storage resources within the specified compartment
112113
* `osmanagement` - Discovers osmanagement resources within the specified compartment
@@ -337,6 +338,10 @@ load_balancer
337338
* oci\_load\_balancer\_path\_route\_set
338339
* oci\_load\_balancer\_rule\_set
339340

341+
monitoring
342+
343+
* oci\_monitoring\_alarm
344+
340345
nosql
341346

342347
* oci\_nosql\_table

0 commit comments

Comments
 (0)