Import existing resources
Every resource of the Terraform provider can be imported by its ID, so objects first built in the FuseScope UI can move under Terraform without being recreated.
Use this page when you already have rules, dashboards or channels in FuseScope and want to manage them as code from now on.
Find the ID
Section titled “Find the ID”Imports use the object’s ID, a UUID such as 0192a9c2-1234-7abc-8def-0123456789ab.
For dashboards and alert rules it is in the page URL when you open the object in
FuseScope. For any object, the list endpoints of the
FuseScope API return
it, for example:
curl -H "SIGNOZ-API-KEY: $FUSESCOPE_ACCESS_TOKEN" \ https://fusescope.example.com/api/v3/rulesfusescope_public_dashboard is imported with the ID of the dashboard it publishes.
Import with an import block
Section titled “Import with an import block”With Terraform 1.5+ or OpenTofu, declare the import and let Terraform write the configuration for you:
-
Add an
importblock:imports.tf import {to = fusescope_rule.checkout_latencyid = "0192a9c2-1234-7abc-8def-0123456789ab"} -
Generate the configuration from the live object:
Terminal window terraform plan -generate-config-out=generated.tf -
Review
generated.tf: rename the resource, replace literal channel names and IDs with references to other resources, and drop attributes you want left at their defaults. -
Run
terraform planagain until it shows only the import and no changes, thenterraform apply. Remove theimportblock afterwards.
Import with the CLI
Section titled “Import with the CLI”On Terraform 1.4, write the resource block yourself and import into it:
terraform import fusescope_dashboard.redis_overview 0192a9c2-1234-7abc-8def-0123456789abterraform planAdjust the configuration until plan shows no changes.
What does not come back
Section titled “What does not come back”- Secrets. A
fusescope_rum_applicationhas a nullkeyafter an import, because FuseScope returns the key only on create; see RUM applications. Generated configuration for a notification channel can hold its credentials; move them into sensitive variables before you commit the file. - Defaults filled by the server. Generated configuration lists every attribute the
server returned. Removing the ones you never set keeps the files short;
plantells you if a removal would change the object.