Creating an Import Job
Create an import job in Resource Manager to import state files for existing resources already managed by Terraform. An import job sets the provided Terraform state file as the current state of the stack.
For example, use an import job to migrate a local Terraform environment to Resource Manager.
After running an import job, get the job's details to check its status. You can optionally view the Terraform state file and view the logs.
Monitor the job status (lifecycle state) by getting the job: Succeeded (SUCCEEDED
) indicates that the job has completed. Depending on the complexity the job, the operation can take some time. While the job runs, or after it completes, you can get the job logs content.
To view the Terraform state file (shows the state of your resources after running the job), click the name of the job to display the Job details page, then click View state under Resources. Optionally select Show changes in this version.
To view the logs for the job, click the name of the job to open the Job details page, then click Logs under Resources.
The import job is created. The new job is listed under Jobs.
Use the
oci resource-manager job create-import-tf-state-job
command and required parameters to run an import job.oci resource-manager job create-import-tf-state-job [OPTIONS]
For a complete list of flags and variable options for CLI commands, see the Command Line Reference for Resource Manager.
Use the CreateJob operation to create an import job.
For an example of the
operation
part of the request, see CreateImportTfStateJobOperationDetails.