Terraform Multi-Tenant Agents (Per Customer)
Deploy a bespoke agent for each customer, each its own module/folder, composed into one shared state and deployed in a single apply. One parent User token plus the provider's run_as attribute targets each customer's child User.
This example runs a multi-tenant product on ChatBotKit where every customer gets their own bespoke agent inside their own isolated child User with its own bots, datasets, conversations, and settings.
Each customer is its own module/folder, so agents can diverge freely - one might be a support bot, another a research agent with a sandbox. A single shared root composes them all and deploys every customer in one apply, with one shared state. Isolation comes from the provider's run_as attribute: you hold one parent User token (CHATBOTKIT_API_KEY) and each module is wired to its customer's child User through a provider alias whose run_as sends the X-RunAs-UserId header. No per-customer tokens, no for_each.
This is the foundation for agency and white-glove products where each customer needs a genuinely different agent that evolves independently.