Skip to content

Conversation

@rkoron007
Copy link
Contributor

@rkoron007 rkoron007 commented Oct 23, 2025

Made an overview and re-adding separate variables, locals, and outputs usage pages. I made this just for v1.12 to make reviewing easier, but after we finalize this, I'll go fix all the links and add redirects in 1.13 and 1.14 as well!

@rkoron007 rkoron007 self-assigned this Oct 23, 2025
@rkoron007 rkoron007 requested review from a team as code owners October 23, 2025 01:11
@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Tue Oct 28 22:50:09 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Tue Oct 28 22:42:42 UTC 2025

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Broken Link Checker

No broken links found! 🎉

"permanent": true
},
// values → parameterize
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting these out for now until we know the new paths.

Copy link
Contributor

@trujillo-adam trujillo-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've done what has been asked, but I'm not sure we're there yet. Of course, I could be way off. Let's sync up outside this PR.


</CodeBlockConfig>

Depending on whether an output value is defined in your root module or a child module, you can access the information exposed in different ways. Terraform displays root module output values in the CLI after you apply your configuration, and if you are using HCP Terraform, your workspace's overview page lists your configuration's outputs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Depending on whether an output value is defined in your root module or a child module, you can access the information exposed in different ways. Terraform displays root module output values in the CLI after you apply your configuration, and if you are using HCP Terraform, your workspace's overview page lists your configuration's outputs.
## Reference data exposed by the `output` block
Depending on whether an output value is defined in your root module or a child module, you can access the information exposed in different ways. Terraform displays root module output values in the CLI after you apply your configuration, and if you are using HCP Terraform, your workspace's overview page lists your configuration's outputs.

Maybe "Consume data exposed . . ." is a better way to characterize it? It seems like there's at least two parts: add the output block to expose the information and then do something with it, which is what the rest of this section seems to be about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think I'm wrong about what this paragraph is about, but I'm leaving the comment here for discussion. I think this is actually about determining which attributes you can reference and expose. Correct? Aren't outputs also described in the provider documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more about explicitly stating the child module outputs are only available to their parent module.

I split this up into two sections to make it clearer that we are talking about accessing output values, then adding a subsection about child modules:

## Access output values

Depending where you define an output value, you can access the information a module exposes in different ways. Terraform displays root module output values in the CLI after you apply your configuration. If you are using HCP Terraform, your workspace's overview page also lists your configuration's outputs.

### Child module outputs

Defining an `output` block in a child module exposes that value to the parent module. You can use outputs to pass a value from a child module to a parent module. Parent modules can access child module outputs using `module.<CHILD_MODULE_NAME>.<OUTPUT_NAME>` syntax.

etc.

> **Hands-on:** Try the [Customize Terraform Configuration with Variables](/terraform/tutorials/configuration-language/variables?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial.
Add `variable` blocks to your configuration so that module consumers can pass in specific input values. This lets module consumers customize module behavior without altering the module's source code. Variables define the interface of your module by specifying what values your module accepts as arguments.
Variables define the interface of your module by specifying what values your module accepts as arguments. The `variable` block lets your module consumers customize module behavior without altering the module's source code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider removing lines 10-12 and starting with the paragraph at line 35 following by the paragraph at line 14.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer the intro was broad, so folks understand what this page is about, before it gets super specific in the following sections.

I'll split the difference with:

"
Variables define the input interface of your module by specifying what values your module accepts as arguments.

Terraform sets up resources with hardcoded values the same way every time, making your module inflexible and potentially hard to reuse. If you know a value in your configuration changes between Terraform operations, you can replace that value with a variable block. A variable block lets module consumers customize module behavior without altering the module's source code.
"

then leaving the following section so they can learn how to define a variable block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants