Hacker News new | ask | show | jobs
by anticristi 1489 days ago
> I think the state mainly exist to know what has been created in the past but since been deleted from manifests and therefore needs to be purged. The caching/performance argument is rather weak, because Terraform refreshes by default anyway before any operation.

Beautiful summary.

For resources with flexible tags, one could easily imagine tags like Kubernetes's:

    terraform.io/name
    terraform.io/instance
However, for tag-less resources you have no choice but to store state to map real-world IDs with what is in the config.

I wish Terraform "tried harder" to avoid state when it can be avoided. Perhaps it could introduce some soft state, where deleted resources are refreshed by looking at tags and not state.

1 comments

Flux, IIRC, uses labels or annotations to do purging. Helm I'd argue falls into the state category with the secrets if uses to track releases.

I do everything with Terraform so I'm not super familiar with either of them. But teams are free to choose their poison.