KusionStack / KusionStack/kusion

Feat: Importing terraform resources takes too long

Open
#1,372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature priority/important-longterm
Dominant language
Go
Stars
1.3k
Forks
107
Avg merge
11m
Merged PRs (30d)
1

Description

What would you like to be added?

Importing a terraform resource takes around 1 minute for the preview step and about 30 seconds for the apply step.
Kusion currently has a --max-concurrent flag that specifies the number of concurrent resource node executions (including terraform) that defaults to 10. This is still relatively slow. Importing 120 resources takes about 20 minutes to complete (Every 10 resources takes about 1 minute and half).
This issues tracks the effort to reduce the 1 minute and half time frame.

Why is this needed?

Another workaround to this is to up the number of --max-concurrent but that has other consequences.
Each terraform CLI execution allegedly takes ~100MB memory usage so a safe number of --max-concurrent may differ case by case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file or test is named. Start by reproducing the 120-resource import and measuring the preview and apply steps with --max-concurrent; done means reducing the reported delays without relying only on a higher concurrency value and while accounting for Terraform CLI memory use.

Written by the indexing model from the issue text.

Assessment

Tech stack
terraform
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.