@intentius/chant-lexicon-aws 0.124.52 → 0.124.54
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.
- package/dist/codegen/generate-lexicon.d.ts +2 -0
- package/dist/codegen/generate-lexicon.d.ts.map +1 -1
- package/dist/codegen/generate-lexicon.js +1 -0
- package/dist/components/__tests__/mock-cloud-executor.d.ts +4 -0
- package/dist/components/__tests__/mock-cloud-executor.d.ts.map +1 -1
- package/dist/components/__tests__/mock-cloud-executor.js +18 -1
- package/dist/components/apply.d.ts +44 -2
- package/dist/components/apply.d.ts.map +1 -1
- package/dist/components/apply.js +260 -29
- package/dist/components/cfn-adopt.d.ts +99 -0
- package/dist/components/cfn-adopt.d.ts.map +1 -0
- package/dist/components/cfn-adopt.js +278 -0
- package/dist/components/cfn-imports.d.ts +84 -0
- package/dist/components/cfn-imports.d.ts.map +1 -0
- package/dist/components/cfn-imports.js +239 -0
- package/dist/components/cloud-executor.d.ts +31 -2
- package/dist/components/cloud-executor.d.ts.map +1 -1
- package/dist/components/cloud-executor.js +64 -2
- package/dist/importable.d.ts +30 -0
- package/dist/importable.d.ts.map +1 -0
- package/dist/importable.js +72 -0
- package/dist/index-identity.d.ts +19 -0
- package/dist/index-identity.d.ts.map +1 -0
- package/dist/index-identity.js +79 -0
- package/dist/index-import.d.ts +17 -0
- package/dist/index-import.d.ts.map +1 -0
- package/dist/index-import.js +115 -0
- package/dist/integrity.json +3 -3
- package/dist/listed-types.d.ts +11 -0
- package/dist/listed-types.d.ts.map +1 -0
- package/dist/listed-types.js +52 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +13206 -1237
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +9 -0
- package/dist/reference-catalog.d.ts.map +1 -1
- package/dist/reference-catalog.js +62 -20
- package/dist/spec/fetch.d.ts +5 -0
- package/dist/spec/fetch.d.ts.map +1 -1
- package/dist/spec/parse.d.ts +8 -0
- package/dist/spec/parse.d.ts.map +1 -1
- package/dist/spec/parse.js +3 -0
- package/package.json +2 -2
- package/src/codegen/generate-lexicon.ts +3 -0
- package/src/components/__tests__/mock-cloud-executor.ts +20 -1
- package/src/components/apply.ts +282 -29
- package/src/components/cfn-adopt.test.ts +284 -0
- package/src/components/cfn-adopt.ts +340 -0
- package/src/components/cfn-exports-in-use.test.ts +146 -0
- package/src/components/cfn-imports-preview.test.ts +178 -0
- package/src/components/cfn-imports-three-stacks.test.ts +107 -0
- package/src/components/cfn-imports.test.ts +213 -0
- package/src/components/cfn-imports.ts +246 -0
- package/src/components/cfn-plan-shape-conformance.test.ts +83 -0
- package/src/components/cloud-executor.ts +102 -5
- package/src/components/demo-composed-stacks-floci.e2e.test.ts +235 -0
- package/src/derived-edges.test.ts +142 -0
- package/src/generated/lexicon-aws.json +13206 -1237
- package/src/importable.test.ts +86 -0
- package/src/importable.ts +83 -0
- package/src/index-identity.test.ts +134 -0
- package/src/index-identity.ts +98 -0
- package/src/index-import.test.ts +242 -0
- package/src/index-import.ts +140 -0
- package/src/index-search.test.ts +87 -0
- package/src/listed-types.test.ts +97 -0
- package/src/listed-types.ts +56 -0
- package/src/plugin.ts +10 -0
- package/src/reference-catalog.ts +63 -20
- package/src/spec/fetch.ts +5 -0
- package/src/spec/parse.test.ts +15 -0
- package/src/spec/parse.ts +12 -0
- package/src/testdata/indexed/identity.listing.json +65 -0
- package/src/testdata/indexed/import.listing.json +126 -0
- package/src/testdata/indexed/listing.json +69 -0
- package/src/testdata/indexed/topology.listing.json +350 -0
- package/src/testdata/three-cloud/dns.graph.json +336 -0
- package/src/three-cloud-parity.test.ts +49 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "The dns member of behold origin/integration/consolidation-graph example-three-cloud, read with chant on integration/consolidation-graph (#4535): chant graph src --format ir --detail 3, ids prefixed with the member as behold composes them.",
|
|
3
|
+
"nodes": [
|
|
4
|
+
{
|
|
5
|
+
"id": "dns/awsCheck",
|
|
6
|
+
"kind": "AWS::Route53::HealthCheck",
|
|
7
|
+
"lexicon": "aws",
|
|
8
|
+
"attrs": {
|
|
9
|
+
"HealthCheckId": {
|
|
10
|
+
"$ref": "awsCheck.HealthCheckId"
|
|
11
|
+
},
|
|
12
|
+
"HealthCheckConfig": {
|
|
13
|
+
"Type": "HTTP",
|
|
14
|
+
"FullyQualifiedDomainName": {
|
|
15
|
+
"$ref": "awsEndpoint"
|
|
16
|
+
},
|
|
17
|
+
"ResourcePath": "/",
|
|
18
|
+
"RequestInterval": 10,
|
|
19
|
+
"FailureThreshold": 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "dns/awsEndpoint",
|
|
25
|
+
"kind": "AWS::CloudFormation::Parameter",
|
|
26
|
+
"lexicon": "aws",
|
|
27
|
+
"attrs": {
|
|
28
|
+
"parameterType": "String",
|
|
29
|
+
"description": "The aws member's load balancer hostname"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "dns/awsRecord",
|
|
34
|
+
"kind": "AWS::Route53::RecordSet",
|
|
35
|
+
"lexicon": "aws",
|
|
36
|
+
"attrs": {
|
|
37
|
+
"HostedZoneId": {
|
|
38
|
+
"$ref": "zone.Id"
|
|
39
|
+
},
|
|
40
|
+
"Name": "www.three-cloud.example.",
|
|
41
|
+
"Type": "CNAME",
|
|
42
|
+
"TTL": "60",
|
|
43
|
+
"SetIdentifier": "aws",
|
|
44
|
+
"Region": "us-east-1",
|
|
45
|
+
"ResourceRecords": [
|
|
46
|
+
{
|
|
47
|
+
"$ref": "awsEndpoint"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"HealthCheckId": {
|
|
51
|
+
"$ref": "awsCheck.HealthCheckId"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "dns/azureCheck",
|
|
57
|
+
"kind": "AWS::Route53::HealthCheck",
|
|
58
|
+
"lexicon": "aws",
|
|
59
|
+
"attrs": {
|
|
60
|
+
"HealthCheckId": {
|
|
61
|
+
"$ref": "azureCheck.HealthCheckId"
|
|
62
|
+
},
|
|
63
|
+
"HealthCheckConfig": {
|
|
64
|
+
"Type": "HTTP",
|
|
65
|
+
"FullyQualifiedDomainName": {
|
|
66
|
+
"$ref": "azureEndpoint"
|
|
67
|
+
},
|
|
68
|
+
"ResourcePath": "/",
|
|
69
|
+
"RequestInterval": 10,
|
|
70
|
+
"FailureThreshold": 1
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "dns/azureEndpoint",
|
|
76
|
+
"kind": "AWS::CloudFormation::Parameter",
|
|
77
|
+
"lexicon": "aws",
|
|
78
|
+
"attrs": {
|
|
79
|
+
"parameterType": "String",
|
|
80
|
+
"description": "The azure member's Container App hostname"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "dns/azureRecord",
|
|
85
|
+
"kind": "AWS::Route53::RecordSet",
|
|
86
|
+
"lexicon": "aws",
|
|
87
|
+
"attrs": {
|
|
88
|
+
"HostedZoneId": {
|
|
89
|
+
"$ref": "zone.Id"
|
|
90
|
+
},
|
|
91
|
+
"Name": "www.three-cloud.example.",
|
|
92
|
+
"Type": "CNAME",
|
|
93
|
+
"TTL": "60",
|
|
94
|
+
"SetIdentifier": "azure",
|
|
95
|
+
"Region": "eu-west-1",
|
|
96
|
+
"ResourceRecords": [
|
|
97
|
+
{
|
|
98
|
+
"$ref": "azureEndpoint"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"HealthCheckId": {
|
|
102
|
+
"$ref": "azureCheck.HealthCheckId"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "dns/front-door",
|
|
108
|
+
"kind": "Chant::Op",
|
|
109
|
+
"lexicon": "chant",
|
|
110
|
+
"attrs": {
|
|
111
|
+
"name": "front-door",
|
|
112
|
+
"overview": "Apply dns, aws, azure and gcp to the emulators, turn Azure off, wait for its health check to fail, export the page to ../export",
|
|
113
|
+
"phases": [
|
|
114
|
+
{
|
|
115
|
+
"name": "Apply",
|
|
116
|
+
"steps": [
|
|
117
|
+
{
|
|
118
|
+
"kind": "activity",
|
|
119
|
+
"fn": "shellCmd",
|
|
120
|
+
"args": {
|
|
121
|
+
"cmd": "cd .. && ./node_modules/.bin/tsx scripts/front-door.ts apply"
|
|
122
|
+
},
|
|
123
|
+
"profile": "atMostOnce",
|
|
124
|
+
"timeout": "15m"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "Turn Azure off",
|
|
130
|
+
"steps": [
|
|
131
|
+
{
|
|
132
|
+
"kind": "activity",
|
|
133
|
+
"fn": "shellCmd",
|
|
134
|
+
"args": {
|
|
135
|
+
"cmd": "cd .. && ./node_modules/.bin/tsx scripts/front-door.ts azure-off"
|
|
136
|
+
},
|
|
137
|
+
"profile": "atMostOnce",
|
|
138
|
+
"timeout": "15m"
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "Wait for Route 53",
|
|
144
|
+
"steps": [
|
|
145
|
+
{
|
|
146
|
+
"kind": "activity",
|
|
147
|
+
"fn": "shellCmd",
|
|
148
|
+
"args": {
|
|
149
|
+
"cmd": "cd .. && ./node_modules/.bin/tsx scripts/front-door.ts wait"
|
|
150
|
+
},
|
|
151
|
+
"profile": "atMostOnce",
|
|
152
|
+
"timeout": "15m"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "Export",
|
|
158
|
+
"steps": [
|
|
159
|
+
{
|
|
160
|
+
"kind": "activity",
|
|
161
|
+
"fn": "shellCmd",
|
|
162
|
+
"args": {
|
|
163
|
+
"cmd": "cd .. && ./node_modules/.bin/tsx scripts/front-door.ts export --out export"
|
|
164
|
+
},
|
|
165
|
+
"profile": "atMostOnce",
|
|
166
|
+
"timeout": "15m"
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "dns/gcpCheck",
|
|
175
|
+
"kind": "AWS::Route53::HealthCheck",
|
|
176
|
+
"lexicon": "aws",
|
|
177
|
+
"attrs": {
|
|
178
|
+
"HealthCheckId": {
|
|
179
|
+
"$ref": "gcpCheck.HealthCheckId"
|
|
180
|
+
},
|
|
181
|
+
"HealthCheckConfig": {
|
|
182
|
+
"Type": "HTTP",
|
|
183
|
+
"IPAddress": {
|
|
184
|
+
"$ref": "gcpEndpoint"
|
|
185
|
+
},
|
|
186
|
+
"Port": 80,
|
|
187
|
+
"ResourcePath": "/",
|
|
188
|
+
"RequestInterval": 10,
|
|
189
|
+
"FailureThreshold": 1
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "dns/gcpEndpoint",
|
|
195
|
+
"kind": "AWS::CloudFormation::Parameter",
|
|
196
|
+
"lexicon": "aws",
|
|
197
|
+
"attrs": {
|
|
198
|
+
"parameterType": "String",
|
|
199
|
+
"description": "The gcp member's load balancer IP address"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "dns/gcpOrigin",
|
|
204
|
+
"kind": "AWS::Route53::RecordSet",
|
|
205
|
+
"lexicon": "aws",
|
|
206
|
+
"attrs": {
|
|
207
|
+
"HostedZoneId": {
|
|
208
|
+
"$ref": "zone.Id"
|
|
209
|
+
},
|
|
210
|
+
"Name": "gcp.three-cloud.example.",
|
|
211
|
+
"Type": "A",
|
|
212
|
+
"TTL": "60",
|
|
213
|
+
"ResourceRecords": [
|
|
214
|
+
{
|
|
215
|
+
"$ref": "gcpEndpoint"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"id": "dns/gcpRecord",
|
|
222
|
+
"kind": "AWS::Route53::RecordSet",
|
|
223
|
+
"lexicon": "aws",
|
|
224
|
+
"attrs": {
|
|
225
|
+
"HostedZoneId": {
|
|
226
|
+
"$ref": "zone.Id"
|
|
227
|
+
},
|
|
228
|
+
"Name": "www.three-cloud.example.",
|
|
229
|
+
"Type": "CNAME",
|
|
230
|
+
"TTL": "60",
|
|
231
|
+
"SetIdentifier": "gcp",
|
|
232
|
+
"Region": "ap-northeast-1",
|
|
233
|
+
"ResourceRecords": [
|
|
234
|
+
"gcp.three-cloud.example."
|
|
235
|
+
],
|
|
236
|
+
"HealthCheckId": {
|
|
237
|
+
"$ref": "gcpCheck.HealthCheckId"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"id": "dns/zone",
|
|
243
|
+
"kind": "AWS::Route53::HostedZone",
|
|
244
|
+
"lexicon": "aws",
|
|
245
|
+
"attrs": {
|
|
246
|
+
"Id": {
|
|
247
|
+
"$ref": "zone.Id"
|
|
248
|
+
},
|
|
249
|
+
"NameServers": {
|
|
250
|
+
"$ref": "zone.NameServers"
|
|
251
|
+
},
|
|
252
|
+
"Name": "three-cloud.example."
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"edges": [
|
|
257
|
+
{
|
|
258
|
+
"from": "dns/awsCheck",
|
|
259
|
+
"to": "dns/awsEndpoint",
|
|
260
|
+
"kind": "ref",
|
|
261
|
+
"viaAttr": "HealthCheckConfig"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"from": "dns/awsRecord",
|
|
265
|
+
"to": "dns/awsCheck",
|
|
266
|
+
"kind": "ref",
|
|
267
|
+
"viaAttr": "HealthCheckId"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"from": "dns/awsRecord",
|
|
271
|
+
"to": "dns/awsEndpoint",
|
|
272
|
+
"kind": "ref",
|
|
273
|
+
"viaAttr": "ResourceRecords"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"from": "dns/awsRecord",
|
|
277
|
+
"to": "dns/zone",
|
|
278
|
+
"kind": "ref",
|
|
279
|
+
"viaAttr": "HostedZoneId"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"from": "dns/azureCheck",
|
|
283
|
+
"to": "dns/azureEndpoint",
|
|
284
|
+
"kind": "ref",
|
|
285
|
+
"viaAttr": "HealthCheckConfig"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"from": "dns/azureRecord",
|
|
289
|
+
"to": "dns/azureCheck",
|
|
290
|
+
"kind": "ref",
|
|
291
|
+
"viaAttr": "HealthCheckId"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"from": "dns/azureRecord",
|
|
295
|
+
"to": "dns/azureEndpoint",
|
|
296
|
+
"kind": "ref",
|
|
297
|
+
"viaAttr": "ResourceRecords"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"from": "dns/azureRecord",
|
|
301
|
+
"to": "dns/zone",
|
|
302
|
+
"kind": "ref",
|
|
303
|
+
"viaAttr": "HostedZoneId"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"from": "dns/gcpCheck",
|
|
307
|
+
"to": "dns/gcpEndpoint",
|
|
308
|
+
"kind": "ref",
|
|
309
|
+
"viaAttr": "HealthCheckConfig"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"from": "dns/gcpOrigin",
|
|
313
|
+
"to": "dns/gcpEndpoint",
|
|
314
|
+
"kind": "ref",
|
|
315
|
+
"viaAttr": "ResourceRecords"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"from": "dns/gcpOrigin",
|
|
319
|
+
"to": "dns/zone",
|
|
320
|
+
"kind": "ref",
|
|
321
|
+
"viaAttr": "HostedZoneId"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"from": "dns/gcpRecord",
|
|
325
|
+
"to": "dns/gcpCheck",
|
|
326
|
+
"kind": "ref",
|
|
327
|
+
"viaAttr": "HealthCheckId"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"from": "dns/gcpRecord",
|
|
331
|
+
"to": "dns/zone",
|
|
332
|
+
"kind": "ref",
|
|
333
|
+
"viaAttr": "HostedZoneId"
|
|
334
|
+
}
|
|
335
|
+
]
|
|
336
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4535: on example-three-cloud's dns member, the aws catalog draws the one
|
|
3
|
+
* edge behold's matcher (behold src/value-match.ts) drew there: the gcp
|
|
4
|
+
* latency record is a CNAME to the gcp origin record, by name. The three
|
|
5
|
+
* records sharing `www.three-cloud.example.` make that name ambiguous, and
|
|
6
|
+
* none of them is referenced by it.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { describe, expect, it } from "vitest";
|
|
11
|
+
import type { IRNode } from "@intentius/chant/graph-ir";
|
|
12
|
+
import { reconstructIndexedEdges } from "@intentius/chant/graph-refs";
|
|
13
|
+
import { awsReferenceCatalog } from "./reference-catalog";
|
|
14
|
+
|
|
15
|
+
const graph = JSON.parse(readFileSync(join(import.meta.dirname, "testdata", "three-cloud", "dns.graph.json"), "utf-8")) as {
|
|
16
|
+
nodes: IRNode[];
|
|
17
|
+
edges: Array<{ from: string; to: string }>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe("example-three-cloud's dns member (parity with behold's matcher)", () => {
|
|
21
|
+
const out = reconstructIndexedEdges(graph.nodes, [{ lexicon: "aws", catalog: awsReferenceCatalog }], () => ({ account: "declared" }));
|
|
22
|
+
const declared = new Set(graph.edges.map((e) => `${e.from}->${e.to}`));
|
|
23
|
+
|
|
24
|
+
it("draws the CNAME edge the matcher drew, and none the declaration lacks besides", () => {
|
|
25
|
+
expect(out.edges.filter((e) => !declared.has(`${e.from}->${e.to}`)).map((e) => `${e.from} -> ${e.to} (${e.rule})`)).toEqual([
|
|
26
|
+
"dns/gcpRecord -> dns/gcpOrigin (aws:AWS::Route53::RecordSet:ResourceRecords[])",
|
|
27
|
+
]);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("leaves nothing ambiguous or dangling", () => {
|
|
31
|
+
expect(out.ambiguous).toEqual([]);
|
|
32
|
+
expect(out.dangling).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("record and bucket identities (#4535)", () => {
|
|
37
|
+
it("does not report a record value outside the estate as dangling", () => {
|
|
38
|
+
const nodes: IRNode[] = [
|
|
39
|
+
{ id: "r", kind: "AWS::Route53::RecordSet", lexicon: "aws", attrs: { Name: "www.example.", Type: "CNAME", ResourceRecords: ["elsewhere.example.net."] } },
|
|
40
|
+
];
|
|
41
|
+
const out = reconstructIndexedEdges(nodes, [{ lexicon: "aws", catalog: awsReferenceCatalog }], () => ({ account: "declared" }));
|
|
42
|
+
expect(out.edges).toEqual([]);
|
|
43
|
+
expect(out.dangling).toEqual([]);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("names a bucket by its BucketName", () => {
|
|
47
|
+
expect(awsReferenceCatalog.identities).toContainEqual({ kind: "AWS::S3::Bucket", ids: ["BucketName"] });
|
|
48
|
+
});
|
|
49
|
+
});
|