Infrastructure as code, topic 49 of 78
State and modules
Terraform remembers what it created in a state file. Keep it in a remote backend, such as an S3 bucket or Terraform Cloud, with locking so that two applies cannot run at once, and treat it as secret: it can hold passwords.
Modules package resources for reuse, so that staging and production are the same code with different inputs. Learn import and moved blocks for resources that already exist or change name.
On Opsfolk
Nothing of ours for this topic yet: an article is on its way.
Elsewhere
- State, TerraformOfficial
- Modules, TerraformOfficial