# Keep a living infrastructure reference page in Notion

> Every Monday we rebuild one Notion page with the current database hostnames, load balancer addresses, and bucket names from your Terraform setup.

- Workflow type: agent
- Services: HCP Terraform (Terraform Cloud), Notion, Slack Bot
- Categories: Engineering, Operations
- Published: 2026-08-14

## What it does

- Reads every workspace in your Terraform organization and collects the values it publishes, such as database hostnames, load balancer addresses, and storage bucket names.
- Rewrites one Notion page each week, grouped into production, staging, and dev, with a short plain-language line explaining what each value is for and when that workspace was last updated.
- Never copies your secrets. Anything Terraform marks as sensitive is listed by name only, with the value hidden.
- Posts a Slack summary only when something actually changed, covering new workspaces, removed workspaces, and values that moved. Quiet weeks stay quiet.

## What you'll need

- An HCP Terraform (Terraform Cloud) account with access to the organization whose workspaces you want documented
- A Notion workspace and one page set aside for the reference doc, shared with your Notion connection so it can be updated
- A Slack workspace and a channel where the weekly change summary should be posted
- Outputs already defined in your Terraform workspaces, since a value can only appear on the page if the workspace publishes it

## Prompt

Every Monday at 8am, rebuild our living infrastructure reference page in Notion using the current state of HCP Terraform, so engineers stop asking in chat what the current database hostname, load balancer address, or bucket name is. Use a cron trigger. When setting this up, ask me for our HCP Terraform organization name, the Notion page to write to, and the Slack channel that should hear about changes.

Start with HCP Terraform's List Workspaces to enumerate every workspace in the organization, paging until you have all of them. For each workspace, pull its published output values with Get Current Workspace Outputs. Where you need the underlying state version detail instead, fall back to List State Version Outputs. Also use Show Current State Version to record when each workspace was last applied, so readers can judge how fresh the values are.

Redaction is the most important rule here. Any output that HCP Terraform marks as sensitive must be listed by name only, with its value redacted, for example "database_password (sensitive, value redacted)". Never write a sensitive value into Notion or Slack, even when the API returns it to you. If you are unsure whether an output is sensitive, treat it as sensitive and redact it.

Organize everything into one clean markdown page. Group workspaces by environment (production, staging, dev), inferring the environment from the workspace name or its tags, and put anything genuinely ambiguous into a separate "Other" group rather than guessing wrong. Within each workspace, show when it was last applied, and write a short plain-language description of what each output actually is, for example "Primary Postgres hostname for the checkout service" rather than dumping raw key and value pairs. The reader is an engineer who wants an answer in five seconds, not a copy of the state file.

Before you overwrite anything, read the existing page with Notion's Retrieve Page as Markdown so you have last week's values to compare against. Then write the new version with Notion's Update Page Content as Markdown, using the replace strategy so the page stays a living document rather than an ever-growing append log. Always write to the same page. Include a line at the top saying when the page was last rebuilt.

Finally, compare this week's values against what was on the page before and send a Slack message with slackbot's Send a Message summarizing only what changed: workspaces that are new, workspaces that have disappeared, and outputs whose values moved. Name the workspace and the output for each change, and keep it short enough to read on a phone. For a sensitive output, say that its value changed without revealing the old or new value. If nothing changed at all, do not post to Slack. Silence is the correct output for a quiet week, and it is what keeps people reading the message when it does arrive.

## How to customize

- Change the schedule. Monday morning suits most teams, but you can run it daily if your infrastructure moves quickly.
- Point it at a different Notion page, or give production its own separate page.
- Choose which Slack channel hears about changes, or narrow the whole run to production workspaces only.

## FAQ

### Will our secrets end up in Notion?

No. Any value your Terraform setup marks as sensitive is written to the page by name only, with the value hidden. The workflow is built so passwords, keys, and connection strings never get copied into your documentation, even though it can see them.

### What happens in a week when nothing changed?

The Notion page still gets refreshed so the last-updated dates stay accurate, and Slack stays completely silent. You only hear from it when there is something real to tell you, which is what keeps people paying attention when it does speak up.

### Does the page keep growing every week?

No. It replaces the contents of the same page each run rather than appending, so you always have one current reference doc instead of a long log of old versions you have to scroll past.

### Can we document only our production infrastructure?

Yes. You can limit the run to production workspaces, or keep covering everything and simply group production at the top. Many teams start with everything and narrow it down later.

### Do our workspaces need to be tagged by environment?

Tags help but are not required. Environments are worked out from workspace names and tags, and anything genuinely ambiguous is grouped separately rather than filed under the wrong environment.

### How do readers know if a value is out of date?

Each workspace on the page shows when it was last applied, so anyone reading can tell at a glance whether they are looking at something refreshed yesterday or untouched for six months.

Use this prompt in General Input: https://www.generalinput.com/prompts/keep-a-living-infrastructure-reference-page-in-notion