Comparison
State filevsState import
State file
the entire record of what your infrastructure is lives in one JSON file, and it contains the database password in clear.
The concrete artefact holding infrastructure state, stored remotely so a team shares one copy. It is simultaneously the most critical and most casually treated file in the estate: losing it means the tool no longer knows anything it built, and it frequently contains secrets in plain text because resource attributes are recorded verbatim. Versioning and encrypting the backend is not optional, and neither is keeping people out of it.
Full entry →State import
the resource already exists because somebody built it in the console, so you tell the tool to adopt it rather than recreate it.
Bringing an already-existing cloud object under management by recording it in state and writing configuration that matches it. It is the standard path for taking a hand-built estate into code, and it is laborious, because the configuration must match reality closely enough that the next plan proposes no changes. Getting it wrong produces a plan that quietly proposes to replace production.
Full entry →