@intentius/chant-lexicon-aws 0.34.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,108 @@
1
+ /**
2
+ * The native AWS read transport (#1206) — the read half of what
3
+ * `op/activities/aws-apply.ts` already does for writes.
4
+ *
5
+ * Every AWS observer shelled `aws …` once per entity, serially, and parsed
6
+ * stderr to find out what went wrong (#1085). The applier does not: `awsApply`
7
+ * speaks the CloudFormation Query protocol over `fetch`, honours an endpoint
8
+ * override, and is injectable for tests. This module is that same transport
9
+ * pointed at the two APIs the read path needs:
10
+ *
11
+ * - **CloudFormation Query** (form-encoded POST, XML back) — the stack reads
12
+ * `describeResources` and the deep pass both start from.
13
+ * - **Cloud Control** (AWS JSON 1.0, `X-Amz-Target: CloudApiService.*`) — the
14
+ * property-level reads (#1015).
15
+ *
16
+ * Both take the endpoint the same way the applier does, so `chant emulator` /
17
+ * behold `--local` keep working by construction rather than by each observer
18
+ * remembering to inject `--endpoint-url`.
19
+ *
20
+ * ## Signing
21
+ *
22
+ * Requests are unsigned, exactly like `awsApply`'s. That is what makes the
23
+ * emulator-first lanes work with no credential plumbing, and it is the reason
24
+ * this is scoped to the Floci lanes (#1198) rather than announced as a
25
+ * real-cloud read path: real AWS rejects an unsigned request. The CLI path
26
+ * remains available for a signed read until SigV4 lands here.
27
+ */
28
+ /** Injectable HTTP, mirroring `AwsHttp` in the applier so tests avoid the network. */
29
+ export type AwsReadHttp = (url: string, init: {
30
+ headers: Record<string, string>;
31
+ body: string;
32
+ }, signal?: AbortSignal) => Promise<{
33
+ status: number;
34
+ text: string;
35
+ }>;
36
+ /** A failed read, carrying enough to classify it without parsing prose. */
37
+ export declare class AwsReadError extends Error {
38
+ readonly status: number;
39
+ /** The API's own error code (`ValidationError`, `UnsupportedOperation`, …) when it sent one. */
40
+ readonly code?: string | undefined;
41
+ constructor(message: string, status: number,
42
+ /** The API's own error code (`ValidationError`, `UnsupportedOperation`, …) when it sent one. */
43
+ code?: string | undefined);
44
+ }
45
+ export interface AwsReadClientOptions {
46
+ /** Endpoint override (Floci `http://localhost:4566`). Omit for real AWS hosts. */
47
+ endpoint?: string;
48
+ /** Region for the real-AWS host and the Query `Version` context. */
49
+ region?: string;
50
+ http?: AwsReadHttp;
51
+ signal?: AbortSignal;
52
+ }
53
+ /** Service host for `service`, honouring an endpoint override. */
54
+ export declare function serviceUrl(service: string, endpoint?: string, region?: string): string;
55
+ /**
56
+ * The `<Tag>text</Tag>` pairs of one XML fragment, as a flat record. Repeated
57
+ * tags keep the first occurrence, which is what a `<member>` body wants —
58
+ * nested lists inside a member are not modelled, because nothing the read path
59
+ * needs from `DescribeStackResources` / `DescribeStacks` is nested that deep.
60
+ */
61
+ export declare function xmlLeaves(fragment: string): Record<string, string>;
62
+ /**
63
+ * Every `<member>…</member>` under `listTag`, each flattened by
64
+ * {@link xmlLeaves}. The Query protocol renders a list as repeated `<member>`
65
+ * elements, and `xmlField` in the applier deliberately does not handle them —
66
+ * it was written for scalar status fields.
67
+ */
68
+ export declare function xmlMembers(xml: string, listTag: string): Array<Record<string, string>>;
69
+ /** `<Error><Code>…</Code><Message>…</Message></Error>`, when the response carries one. */
70
+ export declare function xmlError(xml: string): {
71
+ code?: string;
72
+ message?: string;
73
+ } | undefined;
74
+ /**
75
+ * One CloudFormation Query call. Returns the raw XML; throws
76
+ * {@link AwsReadError} for a non-2xx or an `<Error>` body, so a caller
77
+ * classifies a typed failure instead of matching on stderr.
78
+ */
79
+ export declare function cfnQuery(action: string, params: Record<string, string>, options?: AwsReadClientOptions): Promise<string>;
80
+ /** One stack resource, as `DescribeStackResources` reports it. */
81
+ export interface StackResource {
82
+ logicalId: string;
83
+ type: string;
84
+ physicalId?: string;
85
+ status?: string;
86
+ timestamp?: string;
87
+ }
88
+ /** `DescribeStackResources` for one stack, mapped off the Query XML. */
89
+ export declare function describeStackResources(stackName: string, options?: AwsReadClientOptions): Promise<StackResource[]>;
90
+ /** `DescribeStacks` outputs for one stack, as `key → value`. */
91
+ export declare function describeStackOutputs(stackName: string, options?: AwsReadClientOptions): Promise<Record<string, string>>;
92
+ /** One live resource, as Cloud Control describes it. */
93
+ export interface CloudControlDescription {
94
+ identifier: string;
95
+ properties: Record<string, unknown>;
96
+ }
97
+ /**
98
+ * Cloud Control returns a resource model as a JSON *string* inside the
99
+ * envelope, so every description unwraps twice. Returns null when either level
100
+ * does not parse to an object — an unparseable body is a failed read, not an
101
+ * empty resource.
102
+ */
103
+ export declare function parseResourceDescription(raw: unknown): CloudControlDescription | null;
104
+ /** `GetResource` — the full live model for one identifier. */
105
+ export declare function getResource(typeName: string, identifier: string, options?: AwsReadClientOptions): Promise<CloudControlDescription | null>;
106
+ /** `ListResources` — every live resource of one type, paginated to exhaustion. */
107
+ export declare function listResources(typeName: string, options?: AwsReadClientOptions): Promise<CloudControlDescription[]>;
108
+ //# sourceMappingURL=read-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-client.d.ts","sourceRoot":"","sources":["../../src/api/read-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,sFAAsF;AACtF,MAAM,MAAM,WAAW,GAAG,CACxB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAO/C,2EAA2E;AAC3E,qBAAa,YAAa,SAAQ,KAAK;IAGnC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;gBAHtB,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,MAAM;IACvB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sB,CAC1C,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,EAAE,CAAC,CAS1B;AAED,gEAAgE;AAChE,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAOjC;AAID,wDAAwD;AACxD,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AA4CD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAQrF;AAWD,8DAA8D;AAC9D,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAGzC;AAED,kFAAkF;AAClF,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAiBpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0EH;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0iCjF"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0EH;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2jCjF"}
@@ -23,8 +23,8 @@ export type LambdaFunctionResult = {
23
23
  export declare const LambdaFunction: import("@intentius/chant").CompositeDefinition<LambdaFunctionProps, LambdaFunctionResult>;
24
24
  export declare const LambdaNode: import("@intentius/chant").CompositeDefinition<{
25
25
  name: string | ReturnType<typeof Sub>;
26
- Policies?: InstanceType<typeof Role_Policy>[] | undefined;
27
26
  Code: ConstructorParameters<typeof Function>[0]["Code"];
27
+ Policies?: InstanceType<typeof Role_Policy>[] | undefined;
28
28
  Environment?: ConstructorParameters<typeof Function>[0]["Environment"];
29
29
  VpcConfig?: ConstructorParameters<typeof Function_VpcConfig>[0] | undefined;
30
30
  MemorySize?: number | undefined;
@@ -39,8 +39,8 @@ export declare const LambdaNode: import("@intentius/chant").CompositeDefinition<
39
39
  }, LambdaFunctionResult>;
40
40
  export declare const LambdaPython: import("@intentius/chant").CompositeDefinition<{
41
41
  name: string | ReturnType<typeof Sub>;
42
- Policies?: InstanceType<typeof Role_Policy>[] | undefined;
43
42
  Code: ConstructorParameters<typeof Function>[0]["Code"];
43
+ Policies?: InstanceType<typeof Role_Policy>[] | undefined;
44
44
  Environment?: ConstructorParameters<typeof Function>[0]["Environment"];
45
45
  VpcConfig?: ConstructorParameters<typeof Function_VpcConfig>[0] | undefined;
46
46
  MemorySize?: number | undefined;
@@ -56,8 +56,8 @@ export declare const LambdaPython: import("@intentius/chant").CompositeDefinitio
56
56
  /** @deprecated Use `LambdaNode` instead */
57
57
  export declare const NodeLambda: import("@intentius/chant").CompositeDefinition<{
58
58
  name: string | ReturnType<typeof Sub>;
59
- Policies?: InstanceType<typeof Role_Policy>[] | undefined;
60
59
  Code: ConstructorParameters<typeof Function>[0]["Code"];
60
+ Policies?: InstanceType<typeof Role_Policy>[] | undefined;
61
61
  Environment?: ConstructorParameters<typeof Function>[0]["Environment"];
62
62
  VpcConfig?: ConstructorParameters<typeof Function_VpcConfig>[0] | undefined;
63
63
  MemorySize?: number | undefined;
@@ -73,8 +73,8 @@ export declare const NodeLambda: import("@intentius/chant").CompositeDefinition<
73
73
  /** @deprecated Use `LambdaPython` instead */
74
74
  export declare const PythonLambda: import("@intentius/chant").CompositeDefinition<{
75
75
  name: string | ReturnType<typeof Sub>;
76
- Policies?: InstanceType<typeof Role_Policy>[] | undefined;
77
76
  Code: ConstructorParameters<typeof Function>[0]["Code"];
77
+ Policies?: InstanceType<typeof Role_Policy>[] | undefined;
78
78
  Environment?: ConstructorParameters<typeof Function>[0]["Environment"];
79
79
  VpcConfig?: ConstructorParameters<typeof Function_VpcConfig>[0] | undefined;
80
80
  MemorySize?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"lambda-function.d.ts","sourceRoot":"","sources":["../../src/composites/lambda-function.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAkBpC,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IACvE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,EAAE,CAAC;IAC9C,SAAS,CAAC,EAAE,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC,C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C,CAAC,MAAM,CAAC;eAK5C,YAAY,CAAC,OAAO,WAAW,CAAC,EAAE;kBAF/B,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;gBAG1D,qBAAqB,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC;iBAJlD,MAAM;cADT,MAAM;wBAGI,MAAM,EAAE;eAGjB;QACT,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3D;;;wBAoDqC,CAAC"}
@@ -16,27 +16,80 @@
16
16
  * `describe-stack-resources` already reports per logical id, so the results
17
17
  * line up with the same IR node ids `live-attrs.ts` relies on.
18
18
  *
19
- * ## Scope of the first cut
19
+ * ## One reader, several sources (#1269)
20
20
  *
21
- * Four high-signal types (S3 buckets, IAM roles and managed policies, EC2
22
- * security groups) rather than all 30+. The point of the first row is to prove
23
- * the contract and the noise rules; widening the type table is additive and
24
- * needs no contract change. A declared resource of any other type reports
25
- * NOT-OBSERVED with `unsupported-kind` it may well exist, and saying nothing
26
- * about it is the only honest answer.
21
+ * Cloud Control is the default source, not the only one. It has the property
22
+ * this reader wants most it returns the *CloudFormation resource model*, so
23
+ * its payload lines up with the declared side without translation but its
24
+ * coverage is not the same as the provider's. A security group read through
25
+ * Cloud Control comes back as identity and a description; read through
26
+ * `ec2 describe-security-groups` it comes back with every ingress and egress
27
+ * rule, which is the property people actually edit out of band.
28
+ *
29
+ * So each type names its source in {@link DEEP_SOURCES}, and a source that is
30
+ * not Cloud Control supplies a `toModel` that maps the provider's shape onto
31
+ * the CloudFormation one. Translation is the price of the richer read, and it
32
+ * belongs next to the type it translates rather than inside the diff.
33
+ *
34
+ * A declared resource of a type with no source reports NOT-OBSERVED with
35
+ * `unsupported-kind` — it may well exist, and saying nothing about it is the
36
+ * only honest answer.
27
37
  *
28
38
  * ## Nothing here talks to real AWS on its own terms
29
39
  *
30
- * Every call goes through the runtime adapter's `spawn` and
31
- * `applyAwsEndpointArgv`, so `AWS_ENDPOINT_URL` redirects the whole reader at a
32
- * local emulator exactly as the existing describe path does.
40
+ * Every call goes through `./api/read-client.ts` — the applier's own transport,
41
+ * pointed at the read APIs (#1206) — so `AWS_ENDPOINT_URL` redirects the whole
42
+ * reader at a local emulator, with no CLI to spawn and typed failures instead of
43
+ * parsed stderr.
33
44
  */
34
45
  import type { DeepNormalizationHooks, DeepObservationResult } from "@intentius/chant/lexicon";
46
+ import { type AwsReadHttp } from "./api/read-client.js";
47
+ /**
48
+ * Where each type's live model comes from.
49
+ *
50
+ * `cloud-control` is addressed by the physical id `describe-stack-resources`
51
+ * already reports, and needs no translation. An `ec2` source names a bulk
52
+ * describe — one call for every id of that type, not one per resource — plus
53
+ * the mapping from the EC2 shape onto the CloudFormation model the declared
54
+ * side is written in.
55
+ */
56
+ export type DeepSource = {
57
+ via: "cloud-control";
58
+ } | {
59
+ via: "ec2";
60
+ /** Bulk describe argv, minus the ids and the region. */
61
+ argv: string[];
62
+ /** Flag the physical ids are passed under. */
63
+ idFlag: string;
64
+ /** Top-level key of the result array. */
65
+ key: string;
66
+ /** Field on each row carrying the physical id, for the join back. */
67
+ id: string;
68
+ /** EC2 row -> CloudFormation resource model. */
69
+ toModel: (row: Record<string, unknown>) => Record<string, unknown>;
70
+ };
71
+ export declare const DEEP_SOURCES: Record<string, DeepSource>;
35
72
  /**
36
- * CloudFormation types this reader can read live. Each is addressable in Cloud
37
- * Control by the physical id CloudFormation already reports.
73
+ * Types this reader can read live. Derived from {@link DEEP_SOURCES} so the two
74
+ * cannot drift apart — the shape of bug #1280 is about.
38
75
  */
39
76
  export declare const DEEP_READABLE_TYPES: ReadonlySet<string>;
77
+ /**
78
+ * `describe-security-groups` -> the `AWS::EC2::SecurityGroup` resource model.
79
+ *
80
+ * The two surfaces disagree about names and about nesting. EC2 says
81
+ * `Description` where the template says `GroupDescription`, and nests rule
82
+ * sources under `IpRanges[]` / `Ipv6Ranges[]` / `UserIdGroupPairs[]` where the
83
+ * template writes one flat rule per source. `toIngressRules` already resolves
84
+ * the nesting for the topology fold (#1273); this reuses it so there is one
85
+ * translation of that shape in the lexicon, not two.
86
+ *
87
+ * Rules are matched by their whole canonical value (the `orderKey` hook below),
88
+ * so a field the template carries and this mapping drops is not a smaller diff —
89
+ * it is every rule reported twice, once absent and once undeclared. That is why
90
+ * a range's own `Description` is carried through.
91
+ */
92
+ export declare function securityGroupToModel(row: Record<string, unknown>): Record<string, unknown>;
40
93
  /**
41
94
  * Property names that are server-populated wherever they appear — identifiers
42
95
  * the service mints, timestamps it stamps, counters it maintains. Matched on
@@ -56,6 +109,16 @@ export declare const AWS_READ_ONLY_NAMES: ReadonlySet<string>;
56
109
  * the property in the diff, so a later change to it still reports.
57
110
  */
58
111
  export declare const AWS_SERVICE_DEFAULTS: Record<string, Record<string, unknown>>;
112
+ /**
113
+ * Names the service mints when a template does not supply one (#1269).
114
+ *
115
+ * Unlike {@link AWS_SERVICE_DEFAULTS} there is no fixed value to compare: a
116
+ * CloudFormation-generated security-group name is a different random string on
117
+ * every deploy. Pruned on the live side only, and only where source is silent —
118
+ * a template that names the group keeps the property in the diff, so a later
119
+ * rename still reports.
120
+ */
121
+ export declare const AWS_GENERATED_NAMES: Record<string, ReadonlySet<string>>;
59
122
  /**
60
123
  * The aws lexicon's noise rules. The three classes the epic names for AWS —
61
124
  * server-populated fields, unstable ordering (tags, policy statements), and
@@ -63,18 +126,11 @@ export declare const AWS_SERVICE_DEFAULTS: Record<string, Record<string, unknown
63
126
  * rule that hides drift.
64
127
  */
65
128
  export declare const awsDeepNormalizationHooks: DeepNormalizationHooks;
66
- /** One live resource as `cloudcontrol get-resource` returns it. Exported for tests. */
129
+ /** One live resource as Cloud Control returns it. Exported for tests. */
67
130
  export interface CloudControlResource {
68
131
  identifier: string;
69
132
  properties: Record<string, unknown>;
70
133
  }
71
- /**
72
- * Parse a `cloudcontrol get-resource` payload. Cloud Control returns the model
73
- * as a JSON *string* inside the envelope, so this unwraps twice. Returns null
74
- * for anything that does not parse to an object — an unparseable body is a
75
- * failed read, not an empty resource.
76
- */
77
- export declare function parseCloudControlResource(stdout: string): CloudControlResource | null;
78
134
  /** True when the live property tree carries chant's ownership marker tag. */
79
135
  export declare function hasOwnershipMarker(properties: Record<string, unknown>): boolean;
80
136
  export interface AwsDeepObserveOptions {
@@ -91,16 +147,21 @@ export interface AwsDeepObserveOptions {
91
147
  * silently records no properties for them. */
92
148
  region?: string;
93
149
  owned?: boolean;
150
+ /** Injectable transport, mirroring `awsApply`'s `http` — tests reach the reader without a network. */
151
+ http?: AwsReadHttp;
94
152
  }
95
153
  /**
96
154
  * Read the live property tree for each declared entity via Cloud Control.
97
155
  *
98
- * Two reads per run plus one per readable resource: `describe-stack-resources`
99
- * resolves logical id → (type, physical id), then `cloudcontrol get-resource`
100
- * fetches each model. The first read's failure modes are the thin path's,
101
- * verbatim — a stack that does not exist yet is a real absence (nothing is
102
- * deployed, so there are no properties to drift), anything else is a hole for
103
- * every declared entity.
156
+ * Two reads per run plus one per readable resource: `DescribeStackResources`
157
+ * resolves logical id → (type, physical id), then `GetResource` fetches each
158
+ * model. The first read's failure modes are the thin path's, verbatim — a stack
159
+ * that does not exist yet is a real absence (nothing is deployed, so there are
160
+ * no properties to drift), anything else is a hole for every declared entity.
161
+ *
162
+ * The per-resource reads run concurrently (#1201/#1206). They were serial when
163
+ * each one was a process spawn, which made a deep snapshot of a large stack
164
+ * cost N round trips end to end.
104
165
  */
105
166
  export declare function observeResourcesDeepAws(options: AwsDeepObserveOptions): Promise<DeepObservationResult>;
106
167
  //# sourceMappingURL=deep-observe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deep-observe.d.ts","sourceRoot":"","sources":["../src/deep-observe.ts"],"names":[],"mappings":"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E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsBxE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAEnE,CAAC;AAkBF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,sBAiEvC,CAAC;AAMF,yEAAyE;AACzE,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAmED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAI/E;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;kDAG8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sGAAsG;IACtG,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,qBAAqB,CAAC,CAqIhC"}
@@ -22,12 +22,15 @@ interface RawIpPermission {
22
22
  ToPort?: number;
23
23
  IpRanges?: Array<{
24
24
  CidrIp?: string;
25
+ Description?: string;
25
26
  }>;
26
27
  Ipv6Ranges?: Array<{
27
28
  CidrIpv6?: string;
29
+ Description?: string;
28
30
  }>;
29
31
  UserIdGroupPairs?: Array<{
30
32
  GroupId?: string;
33
+ Description?: string;
31
34
  }>;
32
35
  }
33
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAU,MAAM,0BAA0B,CAAC;AAKhG,uEAAuE;AACvE,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAmB7F;AASD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6OjC"}
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAU,MAAM,0BAA0B,CAAC;AAKhG,uEAAuE;AACvE,UAAU,eAAe;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAwB7F;AASD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE;IACpD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA6OjC"}
package/dist/index.d.ts CHANGED
@@ -13,7 +13,8 @@ export type { StackOutput } from "@intentius/chant/stack-output";
13
13
  export { output, isLexiconOutput } from "@intentius/chant/lexicon-output";
14
14
  export type { LexiconOutput } from "@intentius/chant/lexicon-output";
15
15
  export { awsPlugin } from "./plugin.js";
16
- export { observeResourcesDeepAws, awsDeepNormalizationHooks, parseCloudControlResource, hasOwnershipMarker, DEEP_READABLE_TYPES, AWS_READ_ONLY_NAMES, AWS_SERVICE_DEFAULTS, } from "./deep-observe.js";
16
+ export { observeResourcesDeepAws, awsDeepNormalizationHooks, hasOwnershipMarker, DEEP_READABLE_TYPES, AWS_READ_ONLY_NAMES, AWS_SERVICE_DEFAULTS, } from "./deep-observe.js";
17
+ export { describeStackResources, describeStackOutputs, getResource, listResources, parseResourceDescription, AwsReadError, type AwsReadHttp, type AwsReadClientOptions, type CloudControlDescription, type StackResource, } from "./api/read-client.js";
17
18
  export { Sub, Ref, GetAtt, If, Join, Select, Split, Base64, GetAZs, SubIntrinsic, RefIntrinsic, GetAttIntrinsic, IfIntrinsic, JoinIntrinsic, SelectIntrinsic, SplitIntrinsic, Base64Intrinsic, GetAZsIntrinsic, } from "./intrinsics.js";
18
19
  export { AWS, StackName, Region, AccountId, StackId, URLSuffix, NoValue, NotificationARNs, Partition, } from "./pseudo.js";
19
20
  export * from "./generated/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACzG,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACvI,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG9E,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtF,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC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AAoB,EAAE,eAAe,EACrC,mBAAmB,EAAE,oBAAoB,GAC1C,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "19b9bbcad97c5b76a22524d8a05039ecbca4752d72db220091c254f0afab5380",
4
+ "manifest.json": "39b9cb89de0be79ec9f96b84e9ab60369410b4ca7562b4aba91116ac75443ae1",
5
5
  "meta.json": "f430880414df1288383dc91c313e50ecab26d8e7bcce520bf894eeb89b220e9f",
6
6
  "types/index.d.ts": "4d6f07139586f3d7fc4d9ea0756161587709a39e21f20fbdb05e31f32a44f1c1",
7
7
  "rules/hardcoded-region.ts": "5a0eaf7ab391231fe6cd51426ece29539cb4b36f31c8dd060956638fed55722a",
@@ -59,5 +59,5 @@
59
59
  "skills/chant-aws-eks.md": "8789255709ff004ad0a875fd5999edcdc66fc6e33d710db058d9f42703bcfdfe",
60
60
  "skills/chant-aws-carve-terraform.md": "f4c6fe1c702250665f90d82b3bdaba5ea50ae75e380a8ae321dad6eb1c39683e"
61
61
  },
62
- "composite": "cdde845bc0699082a87af1b7b7558e73c1ddc0db5310eaad60aa26ce8814c41b"
62
+ "composite": "ad1f16796cbb0c159d1d7f525c199b3229ac4f427508b0ad4a22cb0ea30a324b"
63
63
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws",
3
- "version": "0.34.1",
3
+ "version": "0.37.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "AWS",
6
6
  "intrinsics": [
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAgL,MAAM,0BAA0B,CAAC;AA6B5O;yEACyE;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAWnD,eAAO,MAAM,SAAS,EAAE,aAm5BvB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAgL,MAAM,0BAA0B,CAAC;AAoC5O;yEACyE;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAWnD,eAAO,MAAM,SAAS,EAAE,aAu5BvB,CAAC"}
@@ -34,15 +34,31 @@ import type { ResourceMetadata } from "@intentius/chant/lexicon";
34
34
  export declare function stampRegion(resources: Record<string, ResourceMetadata>, region?: string): Record<string, ResourceMetadata>;
35
35
  /** True when this lexicon can read the kind's own properties. */
36
36
  export declare function canDescribe(kind: string): boolean;
37
+ /** What an enrichment pass managed to do, so a caller can tell a miss from a no-op. */
38
+ export interface OwnPropertiesResult {
39
+ resources: Record<string, ResourceMetadata>;
40
+ /**
41
+ * True when enrichment was attempted and *every* kind's read failed — the
42
+ * transport is unavailable rather than the account being quiet. Callers must
43
+ * not present the result as a complete observation (#1089).
44
+ */
45
+ transportFailed: boolean;
46
+ /** Why each failed kind failed, keyed by CloudFormation type, so a caller can attribute per resource. */
47
+ failures: Map<string, string>;
48
+ }
37
49
  /**
38
50
  * Merge each resource's own properties into an observation, in place of nothing.
39
51
  *
40
- * Best-effort per kind, and per kind only: an endpoint that cannot answer
41
- * `describe-subnets` still yields instance properties, and a total failure
42
- * leaves the observation exactly as it arrived. The managed observation is
43
- * already complete without any of this — these are additional facts about
44
- * resources chant has already identified, so a miss costs detail, never
45
- * correctness.
52
+ * Best-effort per kind: an endpoint that cannot answer `describe-subnets` still
53
+ * yields instance properties. A miss costs detail — with one exception that used
54
+ * to be silent and is now reported.
55
+ *
56
+ * The exception (#1206): these attributes are compared by `lifecycle diff`, so a
57
+ * read that fails after the resource is already identified does not degrade to
58
+ * "less detail", it degrades to *drift* — the snapshot has `GroupId`, the live
59
+ * read has nothing, and the differ reports the property as removed. A partial
60
+ * failure still rides the best-effort path, but a total one is a hole the caller
61
+ * has to declare rather than a thinner set of facts.
46
62
  */
47
- export declare function describeOwnProperties(resources: Record<string, ResourceMetadata>, region?: string): Promise<Record<string, ResourceMetadata>>;
63
+ export declare function describeOwnProperties(resources: Record<string, ResourceMetadata>, region?: string): Promise<OwnPropertiesResult>;
48
64
  //# sourceMappingURL=properties.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAkCjE;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAUlC;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAgE3C"}
1
+ {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAkCjE;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAUlC;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,uFAAuF;AACvF,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5C;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,yGAAyG;IACzG,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC3C,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CAyE9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-aws",
3
- "version": "0.34.1",
3
+ "version": "0.37.0",
4
4
  "description": "AWS CloudFormation lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -80,7 +80,7 @@
80
80
  "typescript": "^5.9.3"
81
81
  },
82
82
  "peerDependencies": {
83
- "@intentius/chant": "^0.34.1",
83
+ "@intentius/chant": "^0.37.0",
84
84
  "typescript": "^5.9.3"
85
85
  }
86
86
  }