Resource Discovery

Learn about the Terraform provider's resource discovery feature.

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

Was this article helpful?