IF Commons GitHub

logical/drift

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-estate-iac-drift FR-001, 0004-estate-iac-drift FR-002

Drift between what the code says and what a cloud shows. The code is the assets imported from infrastructure as code that carry an identifier (a state does, a plan of resources not yet made does not); the cloud is what a read-only connector listed. They are matched by provider and identifier, and the difference is said in four words: in the code and not in the cloud (it was deleted, or never made), in the cloud and not in the code (made by hand, or by other code), in both in a different region, and in the code with no identifier (a plan, so nothing can be compared). A resource of a type the code does not cover is not reported as missing from it unless the whole cloud is asked for.

import { driftBetween } from "./drift.ts";
driftBetween([], []); // []

Source: commons/estate-iac/src/logical/drift.ts

1 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.Observedtypeno test imports it
type Observed = { readonly provider: string; readonly type: string; readonly identifier: string; readonly region?: string };

A resource a read-only connector showed.

logical.Drifttypeno test imports it
type Drift = {
  readonly kind: "not-in-cloud" | "not-in-code" | "region-differs" | "no-identifier";
  readonly asset?: string;
  readonly provider: string;
  readonly type: string;
  readonly identifier?: string;
  readonly detail: string;
};

One difference.

logical.driftBetweenfunctionno test imports it
function driftBetween(code: readonly Imported[], cloud: readonly Observed[], options?: { readonly all?: boolean | undefined; }): readonly Drift[]

The differences between the cloud resources of the code and the resources of the cloud. all also reports the resources of the cloud of types the code does not cover.

Observedtypeno test imports it
type Observed = { readonly provider: string; readonly type: string; readonly identifier: string; readonly region?: string };

A resource a read-only connector showed.

Drifttypeno test imports it
type Drift = {
  readonly kind: "not-in-cloud" | "not-in-code" | "region-differs" | "no-identifier";
  readonly asset?: string;
  readonly provider: string;
  readonly type: string;
  readonly identifier?: string;
  readonly detail: string;
};

One difference.

driftBetweenfunction
function driftBetween(code: readonly Imported[], cloud: readonly Observed[], options?: { readonly all?: boolean | undefined; }): readonly Drift[]

The differences between the cloud resources of the code and the resources of the cloud. all also reports the resources of the cloud of types the code does not cover.

Imported by 2 tests of the run (2 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.