Terraform: Modules and Output Variables

Terraform: Modules and Output Variables

Terraform modules package reusable infrastructure. A module exposes inputs and outputs while hiding the details of the resources it creates.

Build a Kinesis module

The course extracts the Kinesis stream resources into a module. The root configuration passes the stream name and other variables to the module. Terraform then uses the output stream identifiers when configuring Lambda and the other resources.

A reusable Terraform module in the project tree

Treat a module as a black box with a documented interface. Variables define what callers can configure. Outputs expose only the values that downstream resources need.

The Kinesis module resources

Run terraform plan after changing a module and check which resources Terraform will create, update, or destroy. Separate modules make it easier to reuse a component across staging and production without copying its implementation.

Optional analytics

Optional analytics are off unless you allow them. Your choice does not affect access to DataTalks.Club, Slack, events, or courses.

Current choice: not chosen.

Privacy Policy

If you allow analytics, self-hosted Umami counts anonymous public pageviews without analytics cookies. Private account and learning pages are excluded. Read the Privacy Policy for the complete data boundary.