@intentius/chant-lexicon-aws 0.124.52 → 0.124.55

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.
Files changed (108) hide show
  1. package/dist/api/credential-chain.d.ts +3 -3
  2. package/dist/api/credential-chain.d.ts.map +1 -1
  3. package/dist/api/credential-chain.js +2 -2
  4. package/dist/api/read-client.d.ts +2 -2
  5. package/dist/api/read-client.d.ts.map +1 -1
  6. package/dist/api/read-client.js +2 -2
  7. package/dist/api/{sigv4.d.ts → signing.d.ts} +14 -34
  8. package/dist/api/signing.d.ts.map +1 -0
  9. package/dist/api/signing.js +95 -0
  10. package/dist/codegen/generate-lexicon.d.ts +2 -0
  11. package/dist/codegen/generate-lexicon.d.ts.map +1 -1
  12. package/dist/codegen/generate-lexicon.js +1 -0
  13. package/dist/components/__tests__/mock-cloud-executor.d.ts +4 -0
  14. package/dist/components/__tests__/mock-cloud-executor.d.ts.map +1 -1
  15. package/dist/components/__tests__/mock-cloud-executor.js +18 -1
  16. package/dist/components/apply.d.ts +46 -2
  17. package/dist/components/apply.d.ts.map +1 -1
  18. package/dist/components/apply.js +266 -30
  19. package/dist/components/cfn-adopt-run.d.ts +37 -0
  20. package/dist/components/cfn-adopt-run.d.ts.map +1 -0
  21. package/dist/components/cfn-adopt-run.js +104 -0
  22. package/dist/components/cfn-adopt.d.ts +99 -0
  23. package/dist/components/cfn-adopt.d.ts.map +1 -0
  24. package/dist/components/cfn-adopt.js +278 -0
  25. package/dist/components/cfn-imports.d.ts +84 -0
  26. package/dist/components/cfn-imports.d.ts.map +1 -0
  27. package/dist/components/cfn-imports.js +239 -0
  28. package/dist/components/cloud-executor.d.ts +38 -2
  29. package/dist/components/cloud-executor.d.ts.map +1 -1
  30. package/dist/components/cloud-executor.js +84 -2
  31. package/dist/health.js +1 -1
  32. package/dist/importable.d.ts +30 -0
  33. package/dist/importable.d.ts.map +1 -0
  34. package/dist/importable.js +72 -0
  35. package/dist/index-identity.d.ts +19 -0
  36. package/dist/index-identity.d.ts.map +1 -0
  37. package/dist/index-identity.js +79 -0
  38. package/dist/index-import.d.ts +25 -0
  39. package/dist/index-import.d.ts.map +1 -0
  40. package/dist/index-import.js +132 -0
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/integrity.json +4 -4
  45. package/dist/listed-types.d.ts +11 -0
  46. package/dist/listed-types.d.ts.map +1 -0
  47. package/dist/listed-types.js +52 -0
  48. package/dist/manifest.json +1 -1
  49. package/dist/meta.json +13206 -1237
  50. package/dist/plugin.d.ts.map +1 -1
  51. package/dist/plugin.js +12 -3
  52. package/dist/reference-catalog.d.ts.map +1 -1
  53. package/dist/reference-catalog.js +62 -20
  54. package/dist/skills/chant-aws-carve-terraform.md +21 -14
  55. package/dist/spec/fetch.d.ts +5 -0
  56. package/dist/spec/fetch.d.ts.map +1 -1
  57. package/dist/spec/parse.d.ts +8 -0
  58. package/dist/spec/parse.d.ts.map +1 -1
  59. package/dist/spec/parse.js +3 -0
  60. package/package.json +2 -2
  61. package/src/api/credential-chain.ts +3 -3
  62. package/src/api/read-client.test.ts +2 -2
  63. package/src/api/read-client.ts +3 -3
  64. package/src/api/{sigv4.test.ts → signing.test.ts} +84 -96
  65. package/src/api/signing.ts +130 -0
  66. package/src/codegen/generate-lexicon.ts +3 -0
  67. package/src/components/__tests__/mock-cloud-executor.ts +20 -1
  68. package/src/components/apply.ts +288 -30
  69. package/src/components/cfn-adopt-run.test.ts +227 -0
  70. package/src/components/cfn-adopt-run.ts +141 -0
  71. package/src/components/cfn-adopt.test.ts +284 -0
  72. package/src/components/cfn-adopt.ts +340 -0
  73. package/src/components/cfn-exports-in-use.test.ts +146 -0
  74. package/src/components/cfn-imports-preview.test.ts +178 -0
  75. package/src/components/cfn-imports-three-stacks.test.ts +107 -0
  76. package/src/components/cfn-imports.test.ts +213 -0
  77. package/src/components/cfn-imports.ts +246 -0
  78. package/src/components/cfn-plan-shape-conformance.test.ts +83 -0
  79. package/src/components/cloud-executor.ts +127 -5
  80. package/src/components/demo-composed-stacks-floci.e2e.test.ts +235 -0
  81. package/src/derived-edges.test.ts +142 -0
  82. package/src/generated/lexicon-aws.json +13206 -1237
  83. package/src/health.ts +1 -1
  84. package/src/importable.test.ts +86 -0
  85. package/src/importable.ts +83 -0
  86. package/src/index-identity.test.ts +134 -0
  87. package/src/index-identity.ts +98 -0
  88. package/src/index-import.test.ts +257 -0
  89. package/src/index-import.ts +158 -0
  90. package/src/index-search.test.ts +87 -0
  91. package/src/index.ts +1 -1
  92. package/src/listed-types.test.ts +97 -0
  93. package/src/listed-types.ts +56 -0
  94. package/src/plugin.ts +13 -3
  95. package/src/reference-catalog.ts +63 -20
  96. package/src/skills/chant-aws-carve-terraform.md +21 -14
  97. package/src/spec/fetch.ts +5 -0
  98. package/src/spec/parse.test.ts +15 -0
  99. package/src/spec/parse.ts +12 -0
  100. package/src/testdata/indexed/identity.listing.json +65 -0
  101. package/src/testdata/indexed/import.listing.json +126 -0
  102. package/src/testdata/indexed/listing.json +69 -0
  103. package/src/testdata/indexed/topology.listing.json +350 -0
  104. package/src/testdata/three-cloud/dns.graph.json +336 -0
  105. package/src/three-cloud-parity.test.ts +49 -0
  106. package/dist/api/sigv4.d.ts.map +0 -1
  107. package/dist/api/sigv4.js +0 -185
  108. package/src/api/sigv4.ts +0 -243
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The aws lexicon's identity rule for indexed resources (#4523, rule written
3
+ * out on INTENTIUS/behold#1025's design comment).
4
+ *
5
+ * The same evidence the stack read's identity fallback uses (#1647,
6
+ * ./identity-observe.ts): the CloudFormation schema's `primaryIdentifier`,
7
+ * which codegen compiled into `lexicon-aws.json`, read off the declared
8
+ * props and `|`-joined the way Cloud Control spells an identifier. behold's
9
+ * lister (behold#1029) writes that Cloud Control `Identifier` as each indexed
10
+ * node's `nativeId`, so a never-deployed bucket declared with `BucketName`
11
+ * and a role declared with `RoleName` match their indexed objects by value.
12
+ *
13
+ * What cannot match:
14
+ * - an identifier part the schema lists in `readOnlyProperties` is assigned
15
+ * by the service (`InstanceId` for `AWS::EC2::Instance`, `QueueUrl` for
16
+ * `AWS::SQS::Queue`), so no declaration states it: `no-binding`;
17
+ * - a part the declaration leaves out or spells with a Ref or an intrinsic:
18
+ * `no-binding`, "identity is not in the declaration";
19
+ * - a type with no primary identifier on record: `unsupported-kind`.
20
+ *
21
+ * Global types are the prefixes behold's aws lister lists once per account at
22
+ * location `global` (behold src/cloud-lister/aws.ts, `isGlobalAwsType`).
23
+ */
24
+ import { createRequire } from "module";
25
+ import { moduleSourceUrl } from "@intentius/chant/module-source";
26
+ const require = createRequire(moduleSourceUrl(import.meta.url));
27
+ const GLOBAL_TYPE_PREFIXES = ["AWS::IAM::", "AWS::CloudFront::", "AWS::Route53::", "AWS::Organizations::", "AWS::GlobalAccelerator::"];
28
+ /** True for a type behold's lister indexes at location `global`. */
29
+ export function isGlobalAwsType(type) {
30
+ return GLOBAL_TYPE_PREFIXES.some((p) => type.startsWith(p));
31
+ }
32
+ let cachedManifest;
33
+ /** The manifest keyed by type, or an empty one in a checkout that has not generated (every type is then `unsupported-kind`). */
34
+ function defaultManifest() {
35
+ if (cachedManifest)
36
+ return cachedManifest;
37
+ try {
38
+ const manifest = require("./generated/lexicon-aws.json");
39
+ cachedManifest = new Map(Object.values(manifest).filter((e) => e.kind === "resource").map((e) => [e.resourceType, e]));
40
+ }
41
+ catch {
42
+ cachedManifest = new Map();
43
+ }
44
+ return cachedManifest;
45
+ }
46
+ /**
47
+ * The identifier an aws declaration spells for the index, or why it spells
48
+ * none. `manifest` is the generated `lexicon-aws.json` keyed by type; a test
49
+ * passes a table.
50
+ */
51
+ export function awsDeclaredIdentity(entityType, props, manifest = defaultManifest()) {
52
+ const entry = manifest.get(entityType);
53
+ const parts = entry?.primaryIdentifier;
54
+ if (!entry || entry.kind !== "resource" || !parts || parts.length === 0) {
55
+ return { kind: "unmatchable", reason: "unsupported-kind", detail: `${entityType} has no primary identifier on record` };
56
+ }
57
+ const readOnly = new Set(Object.values(entry.attrs ?? {}));
58
+ const serverAssigned = parts.filter((p) => readOnly.has(p));
59
+ if (serverAssigned.length > 0) {
60
+ return {
61
+ kind: "unmatchable",
62
+ reason: "no-binding",
63
+ detail: `the identity of ${entityType} (${parts.join(", ")}) is assigned by the service (${serverAssigned.join(", ")}), so no declaration states it`,
64
+ };
65
+ }
66
+ const values = [];
67
+ for (const part of parts) {
68
+ const v = props[part];
69
+ if ((typeof v !== "string" && typeof v !== "number") || String(v) === "") {
70
+ return { kind: "unmatchable", reason: "no-binding", detail: `identity is not in the declaration (${entityType} ${part})` };
71
+ }
72
+ values.push(String(v));
73
+ }
74
+ return { kind: "identifier", listedType: entityType, identifier: values.join("|"), global: isGlobalAwsType(entityType) };
75
+ }
76
+ export const awsIndexIdentity = {
77
+ substrate: "aws",
78
+ declaredIdentity: (entityType, props) => awsDeclaredIdentity(entityType, props),
79
+ };
@@ -0,0 +1,25 @@
1
+ import type { IndexImportCodegen, IndexImportTarget } from "@intentius/chant/lifecycle/index-import";
2
+ /** One `lexicon-aws.json` entry, the fields this seam reads. */
3
+ export interface ImportManifestEntry {
4
+ resourceType: string;
5
+ kind: string;
6
+ /** GetAtt name -> CloudFormation attribute: the schema's `readOnlyProperties`. */
7
+ attrs?: Record<string, string>;
8
+ }
9
+ /**
10
+ * Whether `type` is a resource type this lexicon can write: the listed-type
11
+ * rule (./listed-types.ts) against the registry's kinds. The organization
12
+ * segment is not pinned to `AWS`, so `Alexa::ASK::Skill` imports. With no
13
+ * registry (a checkout that has not generated) every well-formed
14
+ * CloudFormation type does, as the listed-type mapping assumes.
15
+ */
16
+ export declare function isImportableAwsType(type: string, manifest?: ReadonlyMap<string, ImportManifestEntry>): boolean;
17
+ /** The properties a declaration of `type` can hold, from an indexed node's attrs. */
18
+ export declare function awsImportProperties(type: string, attrs: Record<string, unknown>, manifest?: ReadonlyMap<string, ImportManifestEntry>): Record<string, unknown>;
19
+ /** `value` as a reference to `target`, or undefined. */
20
+ export declare function awsImportReference(value: string, target: IndexImportTarget, manifest?: ReadonlyMap<string, ImportManifestEntry>): unknown | undefined;
21
+ /** The resource attributes `chant import --index` writes on every resource it imports (#4536). */
22
+ export declare const ADOPTED_RESOURCE_ATTRIBUTES: Readonly<Record<string, string>>;
23
+ export declare function createAwsIndexImport(manifest?: ReadonlyMap<string, ImportManifestEntry>): IndexImportCodegen;
24
+ export declare const awsIndexImport: IndexImportCodegen;
25
+ //# sourceMappingURL=index-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-import.d.ts","sourceRoot":"","sources":["../src/index-import.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAMrG,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAgBD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAqB,GAAG,OAAO,CAEjI;AAyBD,qFAAqF;AACrF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,QAAQ,GAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAqB,GACrE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB;AAQD,wDAAwD;AACxD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,EACzB,QAAQ,GAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAqB,GACrE,OAAO,GAAG,SAAS,CAUrB;AAED,kGAAkG;AAClG,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAA+D,CAAC;AAEzI,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,kBAAkB,CA0B5G;AAED,eAAO,MAAM,cAAc,EAAE,kBAA2C,CAAC"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * The aws lexicon's index import seam (#4524, `chant import --index`).
3
+ *
4
+ * behold's lister reads AWS through Cloud Control, which returns each
5
+ * object's CloudFormation resource model, and #4521 normalizes it with this
6
+ * lexicon's deep hooks. So an indexed node's `attrs` already are
7
+ * CloudFormation properties, and the import IR is the one the CloudFormation
8
+ * template parser writes (`{ __intrinsic: "Ref" }` and so on), which
9
+ * `CFGenerator` turns into source.
10
+ *
11
+ * - Properties the schema lists in `readOnlyProperties` (the registry's
12
+ * `attrs`) are left out, because no declaration can set them. Tags whose
13
+ * key starts with `aws:` are left out too: CloudFormation sets them and
14
+ * refuses them in a template.
15
+ * - A value that names another imported resource becomes `Ref` when it is
16
+ * that resource's Cloud Control identifier (a single-part one; for the
17
+ * types the catalog joins, Ref returns that identifier), and
18
+ * `GetAtt(<id>, "Arn")` when it is the resource's ARN and the type has an
19
+ * `Arn` attribute. Anything else stays a literal.
20
+ * - A masked value becomes a `String` parameter with `NoEcho`.
21
+ */
22
+ import { createRequire } from "module";
23
+ import { moduleSourceUrl } from "@intentius/chant/module-source";
24
+ import { awsKindForListedType } from "./listed-types.js";
25
+ const require = createRequire(moduleSourceUrl(import.meta.url));
26
+ let cachedManifest;
27
+ /** The generated registry keyed by type, or an empty map in a checkout that has not generated. */
28
+ function defaultManifest() {
29
+ if (cachedManifest)
30
+ return cachedManifest;
31
+ try {
32
+ const manifest = require("./generated/lexicon-aws.json");
33
+ cachedManifest = new Map(Object.values(manifest).filter((e) => e.kind === "resource").map((e) => [e.resourceType, e]));
34
+ }
35
+ catch {
36
+ cachedManifest = new Map();
37
+ }
38
+ return cachedManifest;
39
+ }
40
+ /**
41
+ * Whether `type` is a resource type this lexicon can write: the listed-type
42
+ * rule (./listed-types.ts) against the registry's kinds. The organization
43
+ * segment is not pinned to `AWS`, so `Alexa::ASK::Skill` imports. With no
44
+ * registry (a checkout that has not generated) every well-formed
45
+ * CloudFormation type does, as the listed-type mapping assumes.
46
+ */
47
+ export function isImportableAwsType(type, manifest = defaultManifest()) {
48
+ return awsKindForListedType(type, manifest.size > 0 ? manifestKinds(manifest) : null) !== undefined;
49
+ }
50
+ const kindSets = new WeakMap();
51
+ function manifestKinds(manifest) {
52
+ let kinds = kindSets.get(manifest);
53
+ if (!kinds)
54
+ kindSets.set(manifest, (kinds = new Set(manifest.keys())));
55
+ return kinds;
56
+ }
57
+ function isRecord(v) {
58
+ return typeof v === "object" && v !== null && !Array.isArray(v);
59
+ }
60
+ /** Tags without the `aws:` ones, in either shape CloudFormation uses (a Key/Value list or a map). */
61
+ function withoutAwsTags(tags) {
62
+ if (Array.isArray(tags)) {
63
+ return tags.filter((t) => !(isRecord(t) && typeof t.Key === "string" && t.Key.startsWith("aws:")));
64
+ }
65
+ if (isRecord(tags)) {
66
+ return Object.fromEntries(Object.entries(tags).filter(([k]) => !k.startsWith("aws:")));
67
+ }
68
+ return tags;
69
+ }
70
+ /** The properties a declaration of `type` can hold, from an indexed node's attrs. */
71
+ export function awsImportProperties(type, attrs, manifest = defaultManifest()) {
72
+ const readOnly = new Set(Object.values(manifest.get(type)?.attrs ?? {}).map((a) => a.split(".")[0]));
73
+ const out = {};
74
+ for (const key of Object.keys(attrs).sort()) {
75
+ if (readOnly.has(key))
76
+ continue;
77
+ const value = key === "Tags" ? withoutAwsTags(attrs[key]) : attrs[key];
78
+ if (key === "Tags" && ((Array.isArray(value) && value.length === 0) || (isRecord(value) && Object.keys(value).length === 0)))
79
+ continue;
80
+ out[key] = value;
81
+ }
82
+ return out;
83
+ }
84
+ /** True when `type` exposes `Arn` to GetAtt, or when there is no registry to ask. */
85
+ function hasArnAttribute(type, manifest) {
86
+ if (manifest.size === 0)
87
+ return true;
88
+ return Object.values(manifest.get(type)?.attrs ?? {}).includes("Arn");
89
+ }
90
+ /** `value` as a reference to `target`, or undefined. */
91
+ export function awsImportReference(value, target, manifest = defaultManifest()) {
92
+ const node = target.node;
93
+ if (node.nativeId !== undefined && value === node.nativeId && !value.includes("|")) {
94
+ return { __intrinsic: "Ref", name: target.logicalId };
95
+ }
96
+ const isArn = (node.facts?.cloudIds ?? []).some((c) => c.kind === "arn" && c.value === value);
97
+ if (isArn && hasArnAttribute(node.kind, manifest)) {
98
+ return { __intrinsic: "GetAtt", logicalId: target.logicalId, attribute: "Arn" };
99
+ }
100
+ return undefined;
101
+ }
102
+ /** The resource attributes `chant import --index` writes on every resource it imports (#4536). */
103
+ export const ADOPTED_RESOURCE_ATTRIBUTES = { DeletionPolicy: "Retain", UpdateReplacePolicy: "Retain" };
104
+ export function createAwsIndexImport(manifest) {
105
+ const m = () => manifest ?? defaultManifest();
106
+ return {
107
+ resource(node) {
108
+ if (!isImportableAwsType(node.kind, m()))
109
+ return { unsupported: `${node.kind} is not a CloudFormation resource type the aws lexicon generates` };
110
+ // Retain on every imported resource until a person changes it in source
111
+ // (#4536, ruled on choudoufu#2284 Q4): CloudFormation deletes at stack
112
+ // level and reads no per-resource marker, so an adopted object is never
113
+ // deleted on the stack's word alone. Import requires a DeletionPolicy.
114
+ return { type: node.kind, properties: awsImportProperties(node.kind, node.attrs ?? {}, m()), attributes: { ...ADOPTED_RESOURCE_ATTRIBUTES } };
115
+ },
116
+ reference: (value, target) => awsImportReference(value, target, m()),
117
+ secretParameter(name, context) {
118
+ return {
119
+ name,
120
+ type: "String",
121
+ description: `${context.path} of ${context.node.id}, masked in the index`,
122
+ constraints: { NoEcho: true },
123
+ };
124
+ },
125
+ parameterReference: (name) => ({ __intrinsic: "Ref", name }),
126
+ typeLabel(node) {
127
+ const last = node.kind.split("::").pop() ?? "Resource";
128
+ return last.charAt(0).toUpperCase() + last.slice(1);
129
+ },
130
+ };
131
+ }
132
+ export const awsIndexImport = createAwsIndexImport();
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export type { LexiconOutput } from "@intentius/chant/lexicon-output";
24
24
  export { awsPlugin } from "./plugin.js";
25
25
  export { observeResourcesDeepAws, awsDeepNormalizationHooks, hasOwnershipMarker, DEEP_READABLE_TYPES, AWS_READ_ONLY_NAMES, AWS_SERVICE_DEFAULTS, } from "./deep-observe.js";
26
26
  export { describeStackResources, describeStackOutputs, describeStackDetail, getResource, listResources, parseResourceDescription, resolveEndpointOverride, serviceEndpointEnvVar, AwsReadError, type AwsReadHttp, type AwsReadClientOptions, type CloudControlDescription, type StackResource, type StackDetail, type AwsCredentials, type AwsCredentialResolver, type AwsCredentialSource, } from "./api/read-client.js";
27
- export { signRequest, resolveCredentials, EMPTY_PAYLOAD_SHA256, type SigV4Request, } from "./api/sigv4.js";
27
+ export { signRequest, resolveCredentials, EMPTY_PAYLOAD_SHA256, type SigV4Request, } from "./api/signing.js";
28
28
  export { Sub, Ref, GetAtt, If, Join, Select, Split, Base64, GetAZs, Equals, And, Or, Not, SubIntrinsic, RefIntrinsic, GetAttIntrinsic, IfIntrinsic, JoinIntrinsic, SelectIntrinsic, SplitIntrinsic, Base64Intrinsic, GetAZsIntrinsic, EqualsIntrinsic, AndIntrinsic, OrIntrinsic, NotIntrinsic, FindInMap, FindInMapIntrinsic, ImportValue, ImportValueIntrinsic, Cidr, CidrIntrinsic, } from "./intrinsics.js";
29
29
  export type { ConditionOperand } from "./intrinsics.js";
30
30
  export { AWS, StackName, Region, AccountId, StackId, URLSuffix, NoValue, NotificationARNs, Partition, } from "./pseudo.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,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;AAKvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChI,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ export { describeStackResources, describeStackOutputs, describeStackDetail, getR
42
42
  // SigV4 (#1686). Exported as its own surface because it is deliberately not
43
43
  // specific to this transport: cedar's AVP client is the next caller, and the
44
44
  // point of the module is that there is one signer rather than one per lexicon.
45
- export { signRequest, resolveCredentials, EMPTY_PAYLOAD_SHA256, } from "./api/sigv4.js";
45
+ export { signRequest, resolveCredentials, EMPTY_PAYLOAD_SHA256, } from "./api/signing.js";
46
46
  // Intrinsics
47
47
  export { Sub, Ref, GetAtt, If, Join, Select, Split, Base64, GetAZs, Equals, And, Or, Not, SubIntrinsic, RefIntrinsic, GetAttIntrinsic, IfIntrinsic, JoinIntrinsic, SelectIntrinsic, SplitIntrinsic, Base64Intrinsic, GetAZsIntrinsic, EqualsIntrinsic, AndIntrinsic, OrIntrinsic, NotIntrinsic, FindInMap, FindInMapIntrinsic, ImportValue, ImportValueIntrinsic, Cidr, CidrIntrinsic, } from "./intrinsics.js";
48
48
  // Pseudo-parameters
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "89d93cb161a38540a631c454e1910bc6946da731122a4c017d162f95e8f7dd6d",
5
- "meta.json": "6f48557ed4203cbdeafdb47e7270fdf3533f6d6e6189987246301ed8e72170e9",
4
+ "manifest.json": "247c69acf8d1b5c1d767e8ee6521b8527df273914245f4b608378e1a51485401",
5
+ "meta.json": "5a61f147f0c79262967f826c69a53b8b21fe6c41c6142e6c6c235b595482357f",
6
6
  "types/index.d.ts": "8651f9ae166668f4311eea1fe61c3fe235f345947951c1d23d1df24a4fd3384f",
7
7
  "rules/hardcoded-region.ts": "957eadcaa9f39cc17d21437565d7a94607d9b082cf28918b178fa067f07498a9",
8
8
  "rules/iam-wildcard.ts": "10f5065fa2bbf2c8ce23dfb475a56df33f280df87784e44fec641b2584cbf333",
@@ -73,7 +73,7 @@
73
73
  "rules/waw071.ts": "d0d6e82aa7b347c1a3f41803c53906ea31a085bf04efca7f9bd7894e180b2846",
74
74
  "skills/chant-aws.md": "4d65eb160e001f2af42eb7c622a5b498c2fd1f5afbd6c8155615c010fb265c63",
75
75
  "skills/chant-aws-eks.md": "8789255709ff004ad0a875fd5999edcdc66fc6e33d710db058d9f42703bcfdfe",
76
- "skills/chant-aws-carve-terraform.md": "8780b94ce60aded935938d5ef20ea667738354051da1bf9ca6d70d9886f65d21"
76
+ "skills/chant-aws-carve-terraform.md": "a6f528c814024422744118abbfd9bbf26f3d60c599e90c3f186f8b76e1e38a51"
77
77
  },
78
- "composite": "a28f09250fff6020001c7bf9ab2e315939530ce92656d8aef7d1b13ccc93406a"
78
+ "composite": "27a71fc19e6c03bb110730f8e693d937fd98ca83a0b783ced365bfc5769eb506"
79
79
  }
@@ -0,0 +1,11 @@
1
+ import type { ListedTypeMapping } from "@intentius/chant/lifecycle/type-listing";
2
+ /**
3
+ * The aws kind for a Cloud Control type, or undefined. With no kind set (no
4
+ * generated registry) every well-formed CloudFormation type maps, which is
5
+ * what the rest of the lexicon assumes before `chant generate` has run.
6
+ */
7
+ export declare function awsKindForListedType(listedType: string, kinds?: ReadonlySet<string> | null): string | undefined;
8
+ /** The inverse, for tests and for a reader naming what to list: the same name. */
9
+ export declare function awsListedTypeForKind(kind: string): string;
10
+ export declare const awsListedTypes: ListedTypeMapping;
11
+ //# sourceMappingURL=listed-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listed-types.d.ts","sourceRoot":"","sources":["../src/listed-types.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAsBjF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAuB,GAAG,MAAM,GAAG,SAAS,CAIjI;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,cAAc,EAAE,iBAG5B,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Cloud Control's type names as aws lexicon kinds (#4521).
3
+ *
4
+ * behold#1029 lists AWS through Cloud Control `ListResources`, which names
5
+ * each object by its CloudFormation type (`AWS::S3::Bucket`), and the aws
6
+ * lexicon's kinds are those same names. So the mapping is the identity, kept
7
+ * to the types the lexicon generated: a type outside `lexicon-aws.json` (one
8
+ * newer than the pinned registry, or a third-party type) has no kind here and
9
+ * stays an unknown-kind node. Cloud Control returns the CloudFormation
10
+ * resource model, which is the tree the deep reader returns too
11
+ * (./deep-observe.ts), so no reshaping.
12
+ */
13
+ import { createRequire } from "module";
14
+ import { moduleSourceUrl } from "@intentius/chant/module-source";
15
+ const require = createRequire(moduleSourceUrl(import.meta.url));
16
+ // A CloudFormation type name: `<Organization>::<Service>::<Resource>`. The
17
+ // organization is not always AWS (`Alexa::ASK::Skill`), so it is not pinned.
18
+ const CFN_TYPE = /^[A-Za-z0-9]+::[A-Za-z0-9]+::[A-Za-z0-9]+$/;
19
+ let cachedKinds;
20
+ /** The resource kinds `chant generate` wrote, or null in a checkout that has not generated. */
21
+ function generatedKinds() {
22
+ if (cachedKinds !== undefined)
23
+ return cachedKinds;
24
+ try {
25
+ const manifest = require("./generated/lexicon-aws.json");
26
+ cachedKinds = new Set(Object.values(manifest).filter((e) => e.kind === "resource").map((e) => e.resourceType));
27
+ }
28
+ catch {
29
+ cachedKinds = null;
30
+ }
31
+ return cachedKinds;
32
+ }
33
+ /**
34
+ * The aws kind for a Cloud Control type, or undefined. With no kind set (no
35
+ * generated registry) every well-formed CloudFormation type maps, which is
36
+ * what the rest of the lexicon assumes before `chant generate` has run.
37
+ */
38
+ export function awsKindForListedType(listedType, kinds = generatedKinds()) {
39
+ if (!CFN_TYPE.test(listedType))
40
+ return undefined;
41
+ if (kinds && !kinds.has(listedType))
42
+ return undefined;
43
+ return listedType;
44
+ }
45
+ /** The inverse, for tests and for a reader naming what to list: the same name. */
46
+ export function awsListedTypeForKind(kind) {
47
+ return kind;
48
+ }
49
+ export const awsListedTypes = {
50
+ substrate: "aws",
51
+ kindFor: (listedType) => awsKindForListedType(listedType),
52
+ };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws",
3
- "version": "0.124.52",
3
+ "version": "0.124.55",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "AWS",
6
6
  "intrinsics": [