Skip to main content
You might already have live services in your production environment. To transition to fully automated service management using the Megaport Terraform Provider, the corresponding Terraform configuration file must include resource definitions for all existing services, such as product name, speed, location, and so on. To achieve this, you will need to import these services into the Terraform configuration file.

Importing production services

To import existing production services, follow these steps. We recommend testing the process in the staging environment first. To import production services
  1. Create definitions matching the production service(s) in the target directory where related Terraform configuration files exist. For example, if you want to import an MCR then you need to add the following Terraform configuration file into the target directory.
  2. You can find the product_UID in the Portal. Click the service to view the URL. The alphanumeric information at the end of the URL is the product_UID. You can find the product long UID in the portal
  3. Run the following command:
    Example:
    After the import is complete, you will see a message similar to the following: Import successfully message Confirm that the target service is imported into Terraform as intended by reviewing the terraform.tfstate file.

Helpful references

Last modified on August 21, 2026