kusion icon indicating copy to clipboard operation
kusion copied to clipboard

Feature: implement import method of Terraform Runtime

Open SparkYuan opened this issue 1 year ago • 4 comments

What would you like to be added?

We currently support import K8s resources existing in cluster and Spec(Plan resources) but not existing in kusion_state.json automatically. We also need to support this feature for TF resources.

/pkg/engine/runtime/terraform/terraform_runtime.go#L185

Why is this needed?

Importing TF resources automatically is necessary for our users and can help users to manage all resources they have with kusion.

SparkYuan avatar Mar 16 '23 08:03 SparkYuan

Import resources is supported by Terraform

https://developer.hashicorp.com/terraform/cli/import

SparkYuan avatar Mar 16 '23 08:03 SparkYuan

How to store TF resources now?Local path or other storage(oss/s3)?

ekkoful avatar Apr 11 '23 13:04 ekkoful

How to store TF resources now?Local path or other storage(oss/s3)?

TF resources will be regarded as normal kusion resources and it will be saved in kusion_stat.json. Currently, kusion supports storing kusion_state.json in many storage types, like the local filesystem, oss, database, etc. You can find more details here pkg/engine/states

If you are already familiar with Terraform, we warmly welcome you to participate in this issue. The TerraformRuntime interface provides several other methods that can assist you with this task. However, if you are new to Kusion and Terraform, we suggest taking a look at this 'good first issue' (https://github.com/KusionStack/kusion/issues/173)

SparkYuan avatar Apr 11 '23 13:04 SparkYuan

OK, I‘m familiar with Terraform. But for kusion I need to be familiar with it

ekkoful avatar Apr 11 '23 14:04 ekkoful