cloudposse / atmos

👽 Terraform Orchestration Tool for DevOps. Keep environment configuration DRY with hierarchical imports of configurations, inheritance, and WAY more. Native support for Terraform and Helmfile.
https://atmos.tools
Apache License 2.0
716 stars 92 forks source link

Intelligently don't init on every `apply`/`shell` #620

Open kevcube opened 3 months ago

kevcube commented 3 months ago

Describe the Feature

On a slow connection, even with cached providers, atmos's behavior of running terraform init every time atmos is called slows down the development loop considerably.

Terraform nor terragrunt have this behavior, the first just errors if you don't init, the latter uses a cache dir with hashes of module versions to predict when init is necessary or not.

After digging I see the setting ATMOS_COMPONENTS_TERRAFORM_INIT_RUN_RECONFIGURE but this only seems to control whether the -reconfigure flag is added to init.

Also a note, finding the explanation of settings in the docs is only possible in the table describing the env vars. It should be somewhere higher or on its own page.

Expected Behavior

I would like atmos terraform apply to run terraform apply rather than init && apply

Use Case

Developing faster

Describe Ideal Solution

Some intelligent way to only init when necessary would be ideal.

Alternatives Considered

I can use atmos terraform shell but then my changes to vars in my yaml files require me to either edit the generated json in tandem (error-prone) or to exit my subshell and run atmos shell again (slow)

Additional Context

No response

aknysh commented 3 months ago

@kevcube thank you. We'll review this and improve.

osterman commented 2 months ago

@kevcube have you seen the --skip-init flag? You can add that and then it won't do it automatically.