Skip to content

Commit 248a77c

Browse files
Support resource discovery - analytics resources
1 parent c2e3158 commit 248a77c

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Support `oci_database_autonomous_vm_cluster` for service `database`
99
- Support for `mount_type_details`, `mount_type`, `nfs_server` and `nfs_server_export` attributes in `oci_database_backup_destination` resource
1010
- Support resource discovery for `ons` resources
11-
11+
- Support resource discovery for `analytics` resources
1212
### Fixed
1313
- Fix issue where discovering object storage buckets without lifecycle policies, results in an error
1414

oci/export_definitions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package oci
55

66
import (
7+
oci_analytics "github.com/oracle/oci-go-sdk/analytics"
78
oci_apigateway "github.com/oracle/oci-go-sdk/apigateway"
89
oci_bds "github.com/oracle/oci-go-sdk/bds"
910
oci_budget "github.com/oracle/oci-go-sdk/budget"
@@ -57,6 +58,17 @@ var exportApigatewayDeploymentHints = &TerraformResourceHints{
5758
},
5859
}
5960

61+
var exportAnalyticsAnalyticsInstanceHints = &TerraformResourceHints{
62+
resourceClass: "oci_analytics_analytics_instance",
63+
datasourceClass: "oci_analytics_analytics_instances",
64+
datasourceItemsAttr: "analytics_instances",
65+
resourceAbbreviation: "analytics_instance",
66+
requireResourceRefresh: true,
67+
discoverableLifecycleStates: []string{
68+
string(oci_analytics.AnalyticsInstanceLifecycleStateActive),
69+
},
70+
}
71+
6072
var exportAutoScalingAutoScalingConfigurationHints = &TerraformResourceHints{
6173
resourceClass: "oci_autoscaling_auto_scaling_configuration",
6274
datasourceClass: "oci_autoscaling_auto_scaling_configurations",

oci/export_graphs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var availabilityDomainsGraph = TerraformResourceGraph{
4747

4848
var compartmentResourceGraphs = map[string]TerraformResourceGraph{
4949
"availability_domain": availabilityDomainsGraph,
50+
"analytics": analyticsResourceGraph,
5051
"apigateway": apigatewayResourceGraph,
5152
"auto_scaling": autoScalingResourceGraph,
5253
"bds": bdsResourceGraph,
@@ -79,6 +80,12 @@ var compartmentResourceGraphs = map[string]TerraformResourceGraph{
7980
"waas": waasResourceGraph,
8081
}
8182

83+
var analyticsResourceGraph = TerraformResourceGraph{
84+
"oci_identity_compartment": {
85+
{TerraformResourceHints: exportAnalyticsAnalyticsInstanceHints},
86+
},
87+
}
88+
8289
var apigatewayResourceGraph = TerraformResourceGraph{
8390
"oci_identity_compartment": {
8491
{TerraformResourceHints: exportApigatewayGatewayHints},

website/docs/guides/resource_discovery.html.markdown

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ The generated `.tf` files contain the Terraform configuration with the resources
9090
* `ids` - Comma-separated list of resource IDs to export. The ID could either be an OCID or a Terraform import ID. By default, all resources are exported.
9191
* `output_path` - Path to output generated configurations and state files of the exported compartment
9292
* `services` - Comma-separated list of service resources to export. If not specified, all resources within the given compartment (which excludes identity resources) are exported. The following values can be specified:
93+
* `analytics` - Discovers analytics resources within the specified compartment
9394
* `apigateway` - Discovers apigateway resources within the specified compartment
9495
* `auto_scaling` - Discovers auto_scaling resources within the specified compartment
9596
* `availability_domain` - Discovers availability domains used by your compartment-level resources. It is recommended to always specify this value.
@@ -213,6 +214,10 @@ The list of supported resources can also be retrieved by running this command:
213214
terraform-provider-oci -command=list_export_resources
214215
```
215216

217+
analytics
218+
219+
* oci\_analytics\_analytics\_instance
220+
216221
apigateway
217222

218223
* oci\_apigateway\_gateway

0 commit comments

Comments
 (0)