<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Advanced topics and integrations on InfraBuffet User Guide</title><link>https://infrabuffet.pages.dev/guide/advanced/</link><description>Recent content in Advanced topics and integrations on InfraBuffet User Guide</description><generator>Hugo</generator><language>en</language><atom:link href="https://infrabuffet.pages.dev/guide/advanced/index.xml" rel="self" type="application/rss+xml"/><item><title>Block validation</title><link>https://infrabuffet.pages.dev/guide/advanced/block-validation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/block-validation/</guid><description>&lt;h1 id="block-validation-with-javascript"&gt;Block validation with JavaScript&lt;a class="anchor" href="#block-validation-with-javascript" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;A block template can run a JavaScript validator. InfraBuffet calls it when someone creates or edits a block, after the&#10;normal checks on names, field types, and references. Use it for rules a form schema cannot express, and to compute&#10;values the module needs.&lt;/p&gt;&#10;&lt;p&gt;The validator does not run when someone calculates a diff or applies a plan.&lt;/p&gt;&#10;&lt;h2 id="what-runs-in-order"&gt;What runs, in order&lt;a class="anchor" href="#what-runs-in-order" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Name and field checks: required fields, types, bounds, choices, and regular expressions.&lt;/li&gt;&#10;&lt;li&gt;Reference checks: a selected provider or block must exist in the infrastructure or scope.&lt;/li&gt;&#10;&lt;li&gt;Your &lt;code&gt;validate&lt;/code&gt; function.&lt;/li&gt;&#10;&lt;li&gt;Field checks again, so values your function sets are checked too.&lt;/li&gt;&#10;&lt;li&gt;Reference type, owner-managed dependency, and circular dependency checks.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="write-the-function"&gt;Write the function&lt;a class="anchor" href="#write-the-function" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Define a top-level &lt;code&gt;validate(block, context)&lt;/code&gt; function. It runs synchronously.&lt;/p&gt;</description></item><item><title>Validation API client reference</title><link>https://infrabuffet.pages.dev/guide/advanced/validation-api-client/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/validation-api-client/</guid><description>&lt;h1 id="validation-api-client-reference"&gt;Validation API client reference&lt;a class="anchor" href="#validation-api-client-reference" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Inside &lt;code&gt;validate(block, context)&lt;/code&gt;, &lt;code&gt;context.client.get(path, query)&lt;/code&gt; reads InfraBuffet records.&#10;It is not an HTTP client.&#10;It needs no API token, and it can only read the routes listed below.&lt;/p&gt;&#10;&lt;p&gt;The client does not check the permissions of the user who saves the block. Inside the current infrastructure it can&#10;read everything in the tables below. It can also read any scope by ID, including that scope&amp;rsquo;s Terraform state.&#10;Treat validator code as trusted with that access.&lt;/p&gt;</description></item><item><title>Deduplicators</title><link>https://infrabuffet.pages.dev/guide/advanced/deduplicators/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/deduplicators/</guid><description>&lt;h1 id="deduplicators"&gt;Deduplicators&lt;a class="anchor" href="#deduplicators" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;An infrastructure usually has several scopes, each managed by a different team. Their modules often create&#10;resources in a shared namespace: DNS names, bucket names, database names. Each scope has its own Terraform state, and a&#10;state only knows its own resources, so Terraform cannot stop two scopes from claiming the same name.&lt;/p&gt;&#10;&lt;p&gt;A deduplicator is a short value that every scope has and that is unique within the infrastructure. Combined with the&#10;block name, it gives each block a name that no other block in the infrastructure can have.&lt;/p&gt;</description></item><item><title>Blocks with multiple providers</title><link>https://infrabuffet.pages.dev/guide/advanced/multiple-providers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/multiple-providers/</guid><description>&lt;h1 id="blocks-with-multiple-providers"&gt;Blocks with multiple providers&lt;a class="anchor" href="#blocks-with-multiple-providers" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;A module may need more than one provider configuration, for example two regions or two different providers. A template&#10;can declare one provider field for each. Each field binds a configured provider to a provider name inside the module,&#10;and optionally to an alias.&lt;/p&gt;&#10;&lt;h2 id="example-two-configurations-of-one-provider-type"&gt;Example: two configurations of one provider type&lt;a class="anchor" href="#example-two-configurations-of-one-provider-type" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;This example uses the &lt;code&gt;random&lt;/code&gt; provider, which needs no credentials. Create a provider type &lt;code&gt;random&lt;/code&gt; with source&#10;&lt;code&gt;hashicorp/random&lt;/code&gt; and version &lt;code&gt;3.6.3&lt;/code&gt;. Wait for its schema synchronization job to finish, then create two providers,&#10;&lt;code&gt;random-east&lt;/code&gt; and &lt;code&gt;random-west&lt;/code&gt;, with empty configuration objects.&lt;/p&gt;</description></item><item><title>Blocks that depend on other blocks</title><link>https://infrabuffet.pages.dev/guide/advanced/block-dependencies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/block-dependencies/</guid><description>&lt;h1 id="blocks-that-depend-on-other-blocks"&gt;Blocks that depend on other blocks&lt;a class="anchor" href="#blocks-that-depend-on-other-blocks" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;A &lt;code&gt;block&lt;/code&gt; field lets one block use another block&amp;rsquo;s output. You select a block in the same scope. InfraBuffet passes the&#10;selected module&amp;rsquo;s output as an input, and Terraform orders the work. You do not have to apply blocks in a particular&#10;sequence.&lt;/p&gt;&#10;&lt;h2 id="example-modules"&gt;Example modules&lt;a class="anchor" href="#example-modules" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;These examples use &lt;code&gt;terraform_data&lt;/code&gt;, which is built into Terraform 1.4 and later. They store values in state and create&#10;no cloud resources, so you can try them safely.&lt;/p&gt;</description></item><item><title>API access and tokens</title><link>https://infrabuffet.pages.dev/guide/advanced/api-access/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/api-access/</guid><description>&lt;h1 id="api-access-and-tokens"&gt;API access and tokens&lt;a class="anchor" href="#api-access-and-tokens" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Everything you can do in the UI is also available through the REST API, rooted at &lt;code&gt;/api&lt;/code&gt;. Use it to script&#10;routine work or to connect InfraBuffet to CI pipelines and other tools. Your instance serves an interactive API&#10;reference at &lt;code&gt;/api/swagger/&lt;/code&gt; and the machine-readable specification at &lt;code&gt;/api/swagger/openapi.json&lt;/code&gt;. Treat them as&#10;the source of truth for routes, request fields, and response schemas.&lt;/p&gt;&#10;&lt;h2 id="get-a-token"&gt;Get a token&lt;a class="anchor" href="#get-a-token" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Scripts authenticate with an API token. To create one:&lt;/p&gt;</description></item><item><title>MCP for AI agents</title><link>https://infrabuffet.pages.dev/guide/advanced/mcp/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/mcp/</guid><description>&lt;h1 id="mcp-for-ai-agents"&gt;MCP for AI agents&lt;a class="anchor" href="#mcp-for-ai-agents" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;InfraBuffet provides a Model Context Protocol endpoint at &lt;code&gt;/mcp&lt;/code&gt;. MCP clients can discover and use the same protected&#10;infrastructure and administration operations as the REST API without exposing a separate tool for every route.&lt;/p&gt;&#10;&lt;h2 id="create-a-token"&gt;Create a token&lt;a class="anchor" href="#create-a-token" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Create an API token through &lt;strong&gt;API tokens&lt;/strong&gt; in the user menu, as described in &lt;a href="../api-access/"&gt;API access and tokens&lt;/a&gt;.&#10;Copy the secret when it is shown. Any token can discover operations and read data. Changing objects requires the&#10;&lt;code&gt;write&lt;/code&gt; grant; scheduling diffs, imports and syncs or cancelling jobs requires &lt;code&gt;workflows&lt;/code&gt;; applying a reviewed plan&#10;requires &lt;code&gt;apply&lt;/code&gt;. Tokens cannot be created, listed, read, or revoked through MCP.&lt;/p&gt;</description></item><item><title>Permissions reference</title><link>https://infrabuffet.pages.dev/guide/advanced/permissions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://infrabuffet.pages.dev/guide/advanced/permissions/</guid><description>&lt;h1 id="permissions-reference"&gt;Permissions reference&lt;a class="anchor" href="#permissions-reference" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Find the action you want in the tables below to see who can do it. There is no per-block permission list: access&#10;comes from team membership, infrastructure ownership, and scope grants.&lt;/p&gt;&#10;&lt;h2 id="roles"&gt;Roles&lt;a class="anchor" href="#roles" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Role&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;How you get it&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Superuser&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;A user with superuser status. Bypasses all team checks.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Infra owner&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Member of the infrastructure&amp;rsquo;s owning team.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Scope consumer&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Member of the team a scope is granted to. Infra owners have this access automatically.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Data source owner&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Member of the data source&amp;rsquo;s owning team.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Job team member&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Member of a team recorded on the job when it was scheduled.&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;A user can belong to several teams. A scope is granted to one consumer team. Data sources used by templates must&#10;belong to the infrastructure&amp;rsquo;s owning team.&lt;/p&gt;</description></item></channel></rss>