Resource Discovery

You can use the Oracle Cloud Infrastructure (OCI) Terraform provider's resource discovery feature to search for deployed resources in your compartment and export them to Terraform configuration and state files.

Resource discovery simplifies the move from manually managed infrastructure to Terraform-managed infrastructure. With a single command, you can generate a file that captures your existing compartment's baseline configuration and state.

Important

Resource discovery is not a migration tool. When cloning or migrating resources, configurations generated by resource discovery are a starting point. They may require changes.

Common uses cases for your new Terraform configuration and state files include:

  • Learn how Terraform uses HashiCorp Configuration Language (HCL) syntax to represent Oracle Cloud Infrastructure resources.
  • Duplication or rebuild of your existing infrastructure architecture in a new tenancy or region.
  • Detection of state drift. Run reports to see if the state of your Terraform-managed resources has changed and differs from your base configuration.
Note

Terraform resource discovery is available with OCI Terraform provider version 3.50 and above.

Supported Services

Refer to Terraform Provider Services Reference for the list of services the OCI Terraform provider's resource discovery feature supports. You can also see the list of supported services by running this command:

terraform-provider-oci -command=list_export_services
Note

Terraform resource discovery may not be available for all services that the OCI Terraform provider supports.

Supported Resources

Each supported service has one or more discoverable resources. You can see the list of supported resources by running this command:

terraform-provider-oci -command=list_export_resources
List of supported resources by service parameter

adm

  • oci_adm_vulnerability_audit
  • oci_adm_knowledge_base

ai_anomaly_detection

  • oci_ai_anomaly_detection_data_asset
  • oci_ai_anomaly_detection_model
  • oci_ai_anomaly_detection_project
  • oci_ai_anomaly_detection_ai_private_endpoint

ai_vision

  • oci_ai_vision_project
  • oci_ai_vision_model

analytics

  • oci_analytics_analytics_instance

announcements_service

  • oci_announcements_service_announcement_subscription
  • oci_announcements_service_announcement_subscriptions_actions_change_compartment
  • oci_announcements_service_announcement_subscriptions_filter_group

apigateway

  • oci_apigateway_api
  • oci_apigateway_gateway
  • oci_apigateway_deployment
  • oci_apigateway_certificate
  • oci_apigateway_subscriber
  • oci_apigateway_usage_plan

apm

  • oci_apm_apm_domain

apm_config

  • oci_apm_config_config

apm_synthetics

  • oci_apm_synthetics_script
  • oci_apm_synthetics_monitor
  • oci_apm_synthetics_dedicated_vantage_point

artifacts

  • oci_artifacts_container_configuration
  • oci_artifacts_container_repository
  • oci_artifacts_container_image_signature
  • oci_artifacts_generic_artifact
  • oci_artifacts_repository

auto_scaling

  • oci_autoscaling_auto_scaling_configuration

bastion

  • oci_bastion_bastion
  • oci_bastion_session

bds

  • oci_bds_bds_instance
  • oci_bds_auto_scaling_configuration
  • oci_bds_bds_instance_api_key
  • oci_bds_bds_instance_metastore_config

blockchain

  • oci_blockchain_blockchain_platform
  • oci_blockchain_peer
  • oci_blockchain_osn

budget

  • oci_budget_budget
  • oci_budget_alert_rule

certificates_management

  • oci_certificates_management_ca_bundle
  • oci_certificates_management_certificate_authority
  • oci_certificates_management_certificate

cloud_bridge

  • oci_cloud_bridge_agent_plugin
  • oci_cloud_bridge_agent_dependency
  • oci_cloud_bridge_environment
  • oci_cloud_bridge_agent
  • oci_cloud_bridge_asset_source
  • oci_cloud_bridge_discovery_schedule
  • oci_cloud_bridge_asset
  • oci_cloud_bridge_inventory

cloud_guard

  • oci_cloud_guard_target
  • oci_cloud_guard_managed_list
  • oci_cloud_guard_responder_recipe
  • oci_cloud_guard_data_mask_rule
  • oci_cloud_guard_detector_recipe
  • oci_cloud_guard_security_recipe
  • oci_cloud_guard_security_zone
  • oci_cloud_guard_data_source

cloud_migrations

  • oci_cloud_migrations_migration_asset
  • oci_cloud_migrations_migration_plan
  • oci_cloud_migrations_target_asset
  • oci_cloud_migrations_migration
  • oci_cloud_migrations_replication_schedule

containerengine

  • oci_containerengine_cluster
  • oci_containerengine_node_pool

core

  • oci_core_boot_volume_backup
  • oci_core_boot_volume
  • oci_core_console_history
  • oci_core_cluster_network
  • oci_core_compute_image_capability_schema
  • oci_core_cpe
  • oci_core_cross_connect_group
  • oci_core_cross_connect
  • oci_core_dhcp_options
  • oci_core_drg_attachment
  • oci_core_drg
  • oci_core_dedicated_vm_host
  • oci_core_image
  • oci_core_instance_configuration
  • oci_core_instance_console_connection
  • oci_core_instance_pool_instance
  • oci_core_instance_pool
  • oci_core_instance
  • oci_core_internet_gateway
  • oci_core_ipsec
  • oci_core_local_peering_gateway
  • oci_core_nat_gateway
  • oci_core_network_security_group
  • oci_core_network_security_group_security_rule
  • oci_core_private_ip
  • oci_core_public_ip
  • oci_core_remote_peering_connection
  • oci_core_route_table
  • oci_core_security_list
  • oci_core_service_gateway
  • oci_core_subnet
  • oci_core_vcn
  • oci_core_vlan
  • oci_core_virtual_circuit
  • oci_core_vnic_attachment
  • oci_core_volume_attachment
  • oci_core_volume_backup
  • oci_core_volume_backup_policy
  • oci_core_volume_backup_policy_assignment
  • oci_core_volume_group
  • oci_core_volume_group_backup
  • oci_core_volume
  • oci_core_public_ip_pool
  • oci_core_ipv6
  • oci_core_drg_route_table
  • oci_core_drg_route_distribution
  • oci_core_drg_route_table_route_rule
  • oci_core_capture_filter
  • oci_core_vtap

data_connectivity

  • oci_data_connectivity_registry
  • oci_data_connectivity_registry_connection
  • oci_data_connectivity_registry_data_asset
  • oci_data_connectivity_registry_folder

data_flow

  • oci_dataflow_application
  • oci_dataflow_private_endpoint
  • oci_dataflow_run_statement

data_labeling_service

  • oci_data_labeling_service_dataset

data_safe

  • oci_data_safe_data_safe_private_endpoint
  • oci_data_safe_on_prem_connector
  • oci_data_safe_target_database
  • oci_data_safe_security_assessment
  • oci_data_safe_user_assessment
  • oci_data_safe_unset_security_assessment_baseline
  • oci_data_safe_report_definition
  • oci_data_safe_audit_trail
  • oci_data_safe_alert
  • oci_data_safe_audit_archive_retrieval
  • oci_data_safe_audit_profile
  • oci_data_safe_audit_policy
  • oci_data_safe_target_alert_policy_association
  • oci_data_safe_sensitive_type
  • oci_data_safe_masking_policy
  • oci_data_safe_masking_policies_masking_column
  • oci_data_safe_library_masking_format
  • oci_data_safe_sensitive_data_model
  • oci_data_safe_sensitive_data_models_sensitive_column
  • oci_data_safe_discovery_jobs_result
  • oci_data_safe_discovery_job

database

  • oci_database_autonomous_container_database
  • oci_database_autonomous_container_database_dataguard_association
  • oci_database_autonomous_database
  • oci_database_autonomous_exadata_infrastructure
  • oci_database_autonomous_vm_cluster
  • oci_database_backup_destination
  • oci_database_backup
  • oci_database_database
  • oci_database_db_home
  • oci_database_db_system
  • oci_database_exadata_infrastructure
  • oci_database_vm_cluster_network
  • oci_database_vm_cluster
  • oci_database_database_software_image
  • oci_database_cloud_exadata_infrastructure
  • oci_database_cloud_vm_cluster
  • oci_database_key_store
  • oci_database_external_container_database
  • oci_database_external_pluggable_database
  • oci_database_external_non_container_database
  • oci_database_external_database_connector
  • oci_database_pluggable_database
  • oci_database_vm_cluster_add_virtual_machine
  • oci_database_vm_cluster_remove_virtual_machine
  • oci_database_cloud_autonomous_vm_cluster

database_migration

  • oci_database_migration_connection
  • oci_database_migration_migration

database_tools

  • oci_database_tools_database_tools_private_endpoint
  • oci_database_tools_database_tools_connection

datacatalog

  • oci_datacatalog_catalog
  • oci_datacatalog_data_asset
  • oci_datacatalog_connection
  • oci_datacatalog_catalog_private_endpoint
  • oci_datacatalog_metastore

dataflow

  • oci_dataflow_application
  • oci_dataflow_private_endpoint

dataintegration

  • oci_dataintegration_workspace

datascience

  • oci_datascience_job
  • oci_datascience_job_run
  • oci_datascience_model
  • oci_datascience_model_provenance
  • oci_datascience_model_deployment
  • oci_datascience_notebook_session
  • oci_datascience_pipeline
  • oci_datascience_pipeline_run
  • oci_datascience_project

devops

  • oci_devops_project
  • oci_devops_deploy_environment
  • oci_devops_deploy_artifact
  • oci_devops_deploy_pipeline
  • oci_devops_deploy_stage
  • oci_devops_deployment
  • oci_devops_repository
  • oci_devops_repository_ref
  • oci_devops_build_pipeline
  • oci_devops_build_run
  • oci_devops_connection
  • oci_devops_build_pipeline_stage
  • oci_devops_trigger
  • oci_devops_repository_mirror

disaster_recovery

  • oci_disaster_recovery_dr_protection_group
  • oci_disaster_recovery_dr_plan_execution
  • oci_disaster_recovery_dr_plan

dns

  • oci_dns_zone
  • oci_dns_steering_policy
  • oci_dns_steering_policy_attachment
  • oci_dns_tsig_key
  • oci_dns_rrset
  • oci_dns_resolver
  • oci_dns_resolver_endpoint
  • oci_dns_view

em_warehouse

  • oci_em_warehouse_em_warehouse

email

  • oci_email_suppression
  • oci_email_sender
  • oci_email_email_domain
  • oci_email_dkim

events

  • oci_events_rule

file_storage

  • oci_file_storage_export
  • oci_file_storage_file_system
  • oci_file_storage_mount_target
  • oci_file_storage_replication
  • oci_file_storage_snapshot

functions

  • oci_functions_application
  • oci_functions_function

fusion_apps

  • oci_fusion_apps_fusion_environment_refresh_activity
  • oci_fusion_apps_fusion_environment_admin_user
  • oci_fusion_apps_fusion_environment_family
  • oci_fusion_apps_fusion_environment
  • oci_fusion_apps_fusion_environment_data_masking_activity

golden_gate

  • oci_golden_gate_connection
  • oci_golden_gate_connection_assignment
  • oci_golden_gate_database_registration
  • oci_golden_gate_deployment
  • oci_golden_gate_deployment_backup

health_checks

  • oci_health_checks_http_monitor
  • oci_health_checks_ping_monitor

identity

  • oci_identity_api_key
  • oci_identity_authentication_policy
  • oci_identity_auth_token
  • oci_identity_compartment
  • oci_identity_customer_secret_key
  • oci_identity_dynamic_group
  • oci_identity_group
  • oci_identity_identity_provider
  • oci_identity_idp_group_mapping
  • oci_identity_policy
  • oci_identity_smtp_credential
  • oci_identity_swift_password
  • oci_identity_ui_password
  • oci_identity_user_group_membership
  • oci_identity_user
  • oci_identity_tag_default
  • oci_identity_tag_namespace
  • oci_identity_tag
  • oci_identity_network_source
  • oci_identity_domain
  • oci_identity_db_credential
  • oci_identity_import_standard_tags_management

identity_data_plane

  • oci_identity_data_plane_generate_scoped_access_token

integration

  • oci_integration_integration_instance

jms

  • oci_jms_fleet

kms

  • oci_kms_key
  • oci_kms_key_version
  • oci_kms_vault
  • oci_kms_sign
  • oci_kms_verify

license_manager

  • oci_license_manager_configuration
  • oci_license_manager_product_license
  • oci_license_manager_license_record

limits

  • oci_limits_quota

load_balancer

  • oci_load_balancer_backend
  • oci_load_balancer_backend_set
  • oci_load_balancer_certificate
  • oci_load_balancer_hostname
  • oci_load_balancer_listener
  • oci_load_balancer_load_balancer
  • oci_load_balancer_path_route_set
  • oci_load_balancer_load_balancer_routing_policy
  • oci_load_balancer_rule_set

log_analytics

  • oci_log_analytics_log_analytics_object_collection_rule
  • oci_log_analytics_log_analytics_import_custom_content
  • oci_log_analytics_namespace_scheduled_task
  • oci_log_analytics_log_analytics_preferences_management
  • oci_log_analytics_log_analytics_unprocessed_data_bucket_management
  • oci_log_analytics_log_analytics_resource_categories_management
  • oci_log_analytics_namespace_ingest_time_rule

logging

  • oci_logging_log_group
  • oci_logging_log
  • oci_logging_unified_agent_configuration

management_agent

  • oci_management_agent_management_agent
  • oci_management_agent_management_agent_install_key

marketplace

  • oci_marketplace_accepted_agreement
  • oci_marketplace_publication

media_services

  • oci_media_services_stream_packaging_config
  • oci_media_services_media_workflow
  • oci_media_services_stream_distribution_channel
  • oci_media_services_media_workflow_job
  • oci_media_services_stream_cdn_config
  • oci_media_services_media_asset
  • oci_media_services_media_workflow_configuration

metering_computation

  • oci_metering_computation_query
  • oci_metering_computation_custom_table
  • oci_metering_computation_schedule

monitoring

  • oci_monitoring_alarm

mysql

  • oci_mysql_mysql_configuration
  • oci_mysql_heat_wave_cluster
  • oci_mysql_mysql_backup
  • oci_mysql_mysql_db_system
  • oci_mysql_channel

network_firewall

  • oci_network_firewall_network_firewall_policy
  • oci_network_firewall_network_firewall

network_load_balancer

  • oci_network_load_balancer_network_load_balancer
  • oci_network_load_balancer_backend_set
  • oci_network_load_balancer_backend_sets_health_checker
  • oci_network_load_balancer_backend
  • oci_network_load_balancer_listener

nosql

  • oci_nosql_table
  • oci_nosql_index

object_storage

  • oci_objectstorage_bucket
  • oci_objectstorage_object_lifecycle_policy
  • oci_objectstorage_object
  • oci_objectstorage_preauthrequest
  • oci_objectstorage_replication_policy

oce

  • oci_oce_oce_instance

ocvp

  • oci_ocvp_sddc
  • oci_ocvp_esxi_host

oda

  • oci_oda_oda_instance

ons

  • oci_ons_notification_topic
  • oci_ons_subscription

opa

  • oci_opa_opa_instance

opensearch

  • oci_opensearch_opensearch_cluster

operator_access_control

  • oci_operator_access_control_operator_control
  • oci_operator_access_control_operator_control_assignment

opsi

  • oci_opsi_enterprise_manager_bridge
  • oci_opsi_database_insight
  • oci_opsi_host_insight
  • oci_opsi_exadata_insight
  • oci_opsi_awr_hub
  • oci_opsi_operations_insights_warehouse_user
  • oci_opsi_operations_insights_warehouse
  • oci_opsi_operations_insights_warehouse_download_warehouse_wallet
  • oci_opsi_operations_insights_warehouse_rotate_warehouse_wallet
  • oci_opsi_operations_insights_private_endpoint

optimizer

  • oci_optimizer_profile

osmanagement

  • oci_osmanagement_managed_instance
  • oci_osmanagement_managed_instance_group
  • oci_osmanagement_software_source

osp_gateway

  • oci_osp_gateway_subscription

queue

  • oci_queue_queue

resourcemanager

  • oci_resourcemanager_private_endpoint

sch

  • oci_sch_service_connector

service_mesh

  • oci_service_mesh_virtual_service
  • oci_service_mesh_access_policy
  • oci_service_mesh_mesh
  • oci_service_mesh_ingress_gateway_route_table
  • oci_service_mesh_virtual_service_route_table
  • oci_service_mesh_virtual_deployment
  • oci_service_mesh_ingress_gateway

stack_monitoring

  • oci_stack_monitoring_monitored_resource
  • oci_stack_monitoring_discovery_job
  • oci_stack_monitoring_monitored_resources_list_member
  • oci_stack_monitoring_monitored_resources_search_association
  • oci_stack_monitoring_monitored_resources_search
  • oci_stack_monitoring_monitored_resources_associate_monitored_resource

streaming

  • oci_streaming_connect_harness
  • oci_streaming_stream_pool
  • oci_streaming_stream

usage_proxy

  • oci_usage_proxy_subscription_redeemable_user

vault

  • oci_vault_secret

visual_builder

  • oci_visual_builder_vb_instance

vn_monitoring

  • oci_vn_monitoring_path_analyzer_test
  • oci_vn_monitoring_path_analysi

vulnerability_scanning

  • oci_vulnerability_scanning_host_scan_recipe
  • oci_vulnerability_scanning_host_scan_target
  • oci_vulnerability_scanning_container_scan_recipe
  • oci_vulnerability_scanning_container_scan_target

waa

  • oci_waa_web_app_acceleration_policy
  • oci_waa_web_app_acceleration

waas

  • oci_waas_address_list
  • oci_waas_custom_protection_rule
  • oci_waas_http_redirect
  • oci_waas_waas_policy

waf

  • oci_waf_web_app_firewall_policy
  • oci_waf_web_app_firewall
  • oci_waf_network_address_list