How one configuration serves dev and prod through inputs, how it returns values to the world through outputs, and the HCL expressions, functions, and dynamic blocks that compute everything in between.
7 topics
A configuration that hardcodes every value is a configuration that serves exactly one environment. This chapter is about the parts that make a single config reusable: input variables that parameterize it, outputs that publish its results, locals that name derived values, and the expression language that ties it all together.
These seven topics are where Terraform stops being a list of resources and starts being a program that computes infrastructure. You will type these constructs into almost every config you write — a variable with a validation block, a common-tags local merged into every resource, a templatefile rendering user-data, a dynamic block generating security-group rules. Get them right and the iteration and module chapters that follow are straightforward.