governance.TOOLSconstno test imports itconst TOOLS: readonly ["opentofu", "terraform", "cloudformation", "kubernetes", "compose", "pulumi"]The tools whose files are read.
What an importer gives: assets and links of the estate, each asset with where it came from. An importer reads a file (or the text of one) and runs no tool; it copies only the attributes the estate's catalog names (never the values of a resource, which hold secrets in state), and says in problems what it could not read, so that nothing is dropped without a word.
import { slug } from "./model.ts";
slug("tf", "aws_instance.web[0]"); // "tf-aws-instance-web-0"governance.TOOLSconstno test imports itconst TOOLS: readonly ["opentofu", "terraform", "cloudformation", "kubernetes", "compose", "pulumi"]The tools whose files are read.
governance.Tooltypeno test imports ittype Tool = (typeof TOOLS)[number];A tool whose files are read.
governance.Importedtypeno test imports ittype Imported = { readonly id: string; readonly kind: string; readonly attributes: Readonly<Record<string, AttributeValue>> };An asset an importer found: its identity, kind and attributes (with provenance among them). The state of the asset is discovered: reading code adopts nothing.
governance.ImportedLinktypeno test imports ittype ImportedLink = { readonly from: string; readonly to: string; readonly kind: string };A link an importer found, between the identities of two imported assets.
governance.Importstypeno test imports ittype Imports = { readonly tool: Tool; readonly source: string; readonly assets: readonly Imported[]; readonly links: readonly ImportedLink[]; readonly problems: readonly string[] };What an importer gives for one file.
governance.provenanceOffunctionno test imports itfunction provenanceOf(tool: "cloudformation" | "compose" | "kubernetes" | "opentofu" | "pulumi" | "terraform", source: string, address: string): stringWhere an asset was read from, as tool:file#address.
governance.slugfunctionno test imports itfunction slug(...parts: readonly string[]): stringAn asset identity from words: lower case, letters and digits joined by hyphens, starting with the first word (a prefix that begins with a letter), at most 100 characters.
governance.IdPoolclassno test imports itclass IdPoolA set of identities in use, that gives the first free one: the identity, then it with -2, -3 and so on.
| Member | Type | What it is |
|---|---|---|
take | (base: string) => string |
governance.linkForfunctionno test imports itfunction linkFor(needs: Imported, needed: Imported): ImportedLinkThe link between two imported assets where the first needs the second, named by the kinds of both: an endpoint that needs a resource is exposed by it, an endpoint that needs a certificate is secured by it, a name that needs an asset resolves to it, and any other is a dependency.
governance.presentfunctionno test imports itfunction present(a: Readonly<Record<string, AttributeValue | undefined>>): Readonly<Record<string, AttributeValue>>The attributes without the ones that have no value.
governance.distinctLinksfunctionno test imports itfunction distinctLinks(links: readonly ImportedLink[]): readonly ImportedLink[]Links without the ones that repeat or join an asset to itself, in order.
TOOLSconstno test imports itconst TOOLS: readonly ["opentofu", "terraform", "cloudformation", "kubernetes", "compose", "pulumi"]The tools whose files are read.
Tooltypeno test imports ittype Tool = (typeof TOOLS)[number];A tool whose files are read.
Importedtypetype Imported = { readonly id: string; readonly kind: string; readonly attributes: Readonly<Record<string, AttributeValue>> };An asset an importer found: its identity, kind and attributes (with provenance among them). The state of the asset is discovered: reading code adopts nothing.
ImportedLinktypeno test imports ittype ImportedLink = { readonly from: string; readonly to: string; readonly kind: string };A link an importer found, between the identities of two imported assets.
Importstypetype Imports = { readonly tool: Tool; readonly source: string; readonly assets: readonly Imported[]; readonly links: readonly ImportedLink[]; readonly problems: readonly string[] };What an importer gives for one file.
provenanceOffunctionfunction provenanceOf(tool: "cloudformation" | "compose" | "kubernetes" | "opentofu" | "pulumi" | "terraform", source: string, address: string): stringWhere an asset was read from, as tool:file#address.
slugfunctionfunction slug(...parts: readonly string[]): stringAn asset identity from words: lower case, letters and digits joined by hyphens, starting with the first word (a prefix that begins with a letter), at most 100 characters.
IdPoolclassclass IdPoolA set of identities in use, that gives the first free one: the identity, then it with -2, -3 and so on.
| Member | Type | What it is |
|---|---|---|
take | (base: string) => string |
linkForfunctionfunction linkFor(needs: Imported, needed: Imported): ImportedLinkThe link between two imported assets where the first needs the second, named by the kinds of both: an endpoint that needs a resource is exposed by it, an endpoint that needs a certificate is secured by it, a name that needs an asset resolves to it, and any other is a dependency.
presentfunctionno test imports itfunction present(a: Readonly<Record<string, AttributeValue | undefined>>): Readonly<Record<string, AttributeValue>>The attributes without the ones that have no value.
distinctLinksfunctionfunction distinctLinks(links: readonly ImportedLink[]): readonly ImportedLink[]Links without the ones that repeat or join an asset to itself, in order.