Skip to main content

Existing Environment Import

Import

Torque lets you import your existing environments. Once the environment is imported it becomes a fully managed environment in Torque. This allows you to gain visibility of all the environments that were created outside of Torque and use Torque environment services like drift detection, updates, cost tracking & introspection with the imported environments.

Import without a blueprint

The import flow supports auto-generating a blueprint as part of the import request. This is useful in case you need to import an environment with a single grain and you don't have a corresponding blueprint yet.

Example of a basic API request:

curl -L 'https://portal.qtorque.io/api/spaces/<SPACE_NAME>/environments/import' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"environment_name": "<ENV_NAME>",
"inputs": {
"agent": "<AGENT_NAME>"
// additional inputs as needed
},
"grains": [
{
"kind": "terraform",
"source": {
"store": "<REPO_NAME>",
"path": "<PATH_TO_TERRAFORM_MODULE>"
},
"credentials": ["<CLOUD_CREDENTIALS>"],
"backend": {
"type": "s3", // s3|azurerm|gcs|http
"bucket": "<BUCKET_NAME>",
"region": "<REGION_NAME>",
"key": "<PATH_TO_TF_STATE_FILE>"
}
}
]
}'

Full API reference is available here.

  • It's important to note that the backend section is mandatory and must reference a *.tfstate file in a supported backend (s3/azurerm/gcs/http). Also, the input values that are provided as part of the import request must be the same values that were used to provision the terraform module. If the input values do not match, Torque will detect a drift and fail the import.

Import using existing blueprint

The import feature also supports using an existing blueprint. It's useful in case where you need to import an environment with multiple grains or in case that you need to import multiple environments that were created from the same configurations. Full API reference is available here.

Limitations

  • Import is currently supported only for environments created with Terraform.
  • The import flow with auto-generated blueprint supports only a single grain.

Release

The release flow allows to end a Torque environment without destroying the underlying resources. This feature is currently available only using an API call.