alchemy 0.54.0 → 0.55.1
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/bin/alchemy.js +38717 -11847
- package/lib/aws/ec2/index.d.ts +10 -0
- package/lib/aws/ec2/index.d.ts.map +1 -0
- package/lib/aws/ec2/index.js +10 -0
- package/lib/aws/ec2/index.js.map +1 -0
- package/lib/aws/ec2/internet-gateway-attachment.d.ts +150 -0
- package/lib/aws/ec2/internet-gateway-attachment.d.ts.map +1 -0
- package/lib/aws/ec2/internet-gateway-attachment.js +248 -0
- package/lib/aws/ec2/internet-gateway-attachment.js.map +1 -0
- package/lib/aws/ec2/internet-gateway.d.ts +132 -0
- package/lib/aws/ec2/internet-gateway.d.ts.map +1 -0
- package/lib/aws/ec2/internet-gateway.js +311 -0
- package/lib/aws/ec2/internet-gateway.js.map +1 -0
- package/lib/aws/ec2/nat-gateway.d.ts +145 -0
- package/lib/aws/ec2/nat-gateway.d.ts.map +1 -0
- package/lib/aws/ec2/nat-gateway.js +618 -0
- package/lib/aws/ec2/nat-gateway.js.map +1 -0
- package/lib/aws/ec2/route-table-association.d.ts +134 -0
- package/lib/aws/ec2/route-table-association.d.ts.map +1 -0
- package/lib/aws/ec2/route-table-association.js +364 -0
- package/lib/aws/ec2/route-table-association.js.map +1 -0
- package/lib/aws/ec2/route-table.d.ts +94 -0
- package/lib/aws/ec2/route-table.d.ts.map +1 -0
- package/lib/aws/ec2/route-table.js +253 -0
- package/lib/aws/ec2/route-table.js.map +1 -0
- package/lib/aws/ec2/route.d.ts +130 -0
- package/lib/aws/ec2/route.d.ts.map +1 -0
- package/lib/aws/ec2/route.js +253 -0
- package/lib/aws/ec2/route.js.map +1 -0
- package/lib/aws/ec2/security-group-rule.d.ts +84 -0
- package/lib/aws/ec2/security-group-rule.d.ts.map +1 -0
- package/lib/aws/ec2/security-group-rule.js +123 -0
- package/lib/aws/ec2/security-group-rule.js.map +1 -0
- package/lib/aws/ec2/security-group.d.ts +84 -0
- package/lib/aws/ec2/security-group.d.ts.map +1 -0
- package/lib/aws/ec2/security-group.js +207 -0
- package/lib/aws/ec2/security-group.js.map +1 -0
- package/lib/aws/ec2/subnet.d.ts +110 -0
- package/lib/aws/ec2/subnet.d.ts.map +1 -0
- package/lib/aws/ec2/subnet.js +336 -0
- package/lib/aws/ec2/subnet.js.map +1 -0
- package/lib/aws/ec2/utils.d.ts +15 -0
- package/lib/aws/ec2/utils.d.ts.map +1 -0
- package/lib/aws/ec2/utils.js +79 -0
- package/lib/aws/ec2/utils.js.map +1 -0
- package/lib/aws/ec2/vpc.d.ts +160 -0
- package/lib/aws/ec2/vpc.d.ts.map +1 -0
- package/lib/aws/ec2/vpc.js +453 -0
- package/lib/aws/ec2/vpc.js.map +1 -0
- package/lib/aws/index.d.ts +7 -0
- package/lib/aws/index.d.ts.map +1 -1
- package/lib/aws/index.js +8 -0
- package/lib/aws/index.js.map +1 -1
- package/lib/aws/utils.d.ts +25 -0
- package/lib/aws/utils.d.ts.map +1 -0
- package/lib/aws/utils.js +89 -0
- package/lib/aws/utils.js.map +1 -0
- package/lib/build-date.d.ts +6 -0
- package/lib/build-date.d.ts.map +1 -0
- package/lib/build-date.js +8 -0
- package/lib/build-date.js.map +1 -0
- package/lib/cloudflare/worker-metadata.d.ts +1 -1
- package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
- package/lib/cloudflare/worker-metadata.js +1 -0
- package/lib/cloudflare/worker-metadata.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +0 -2
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +1 -1
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/util/params.d.ts +5 -0
- package/lib/util/params.d.ts.map +1 -0
- package/lib/util/params.js +30 -0
- package/lib/util/params.js.map +1 -0
- package/lib/util/timeout.d.ts +31 -0
- package/lib/util/timeout.d.ts.map +1 -0
- package/lib/util/timeout.js +109 -0
- package/lib/util/timeout.js.map +1 -0
- package/lib/util/xml.d.ts +5 -0
- package/lib/util/xml.d.ts.map +1 -0
- package/lib/util/xml.js +8 -0
- package/lib/util/xml.js.map +1 -0
- package/package.json +7 -5
- package/src/aws/ec2/index.ts +9 -0
- package/src/aws/ec2/internet-gateway-attachment.ts +468 -0
- package/src/aws/ec2/internet-gateway.ts +557 -0
- package/src/aws/ec2/nat-gateway.ts +1123 -0
- package/src/aws/ec2/route-table-association.ts +747 -0
- package/src/aws/ec2/route-table.ts +452 -0
- package/src/aws/ec2/route.ts +447 -0
- package/src/aws/ec2/security-group-rule.ts +229 -0
- package/src/aws/ec2/security-group.ts +418 -0
- package/src/aws/ec2/subnet.ts +625 -0
- package/src/aws/ec2/utils.ts +102 -0
- package/src/aws/ec2/vpc.ts +969 -0
- package/src/aws/index.ts +9 -0
- package/src/aws/utils.ts +137 -0
- package/src/build-date.ts +8 -0
- package/src/cloudflare/worker-metadata.ts +1 -1
- package/src/cloudflare/worker.ts +1 -1
- package/src/util/params.ts +33 -0
- package/src/util/timeout.ts +178 -0
- package/src/util/xml.ts +7 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
import { Resource } from "../../resource.js";
|
|
3
|
+
import { ignore } from "../../util/ignore.js";
|
|
4
|
+
import { logger } from "../../util/logger.js";
|
|
5
|
+
import { mergeTimeoutConfig, waitForResourceState, } from "../../util/timeout.js";
|
|
6
|
+
import { callEC2Api, createEC2Client } from "./utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* AWS Route Table Resource
|
|
9
|
+
*
|
|
10
|
+
* Creates and manages route tables that control the routing of network traffic
|
|
11
|
+
* within a VPC. Route tables contain rules (routes) that determine where network
|
|
12
|
+
* traffic is directed. Subnet associations are managed separately using the
|
|
13
|
+
* RouteTableAssociation resource.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Create a basic route table
|
|
17
|
+
* const routeTable = await RouteTable("main-route-table", {
|
|
18
|
+
* vpc: myVpc,
|
|
19
|
+
* tags: {
|
|
20
|
+
* Name: "main-route-table",
|
|
21
|
+
* Environment: "production"
|
|
22
|
+
* }
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Create a public route table for internet access
|
|
27
|
+
* const publicRouteTable = await RouteTable("public-routes", {
|
|
28
|
+
* vpc: myVpc,
|
|
29
|
+
* tags: {
|
|
30
|
+
* Name: "public-route-table",
|
|
31
|
+
* Type: "public",
|
|
32
|
+
* Purpose: "internet-access"
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Create a private route table for internal traffic
|
|
38
|
+
* const privateRouteTable = await RouteTable("private-routes", {
|
|
39
|
+
* vpc: myVpc,
|
|
40
|
+
* tags: {
|
|
41
|
+
* Name: "private-route-table",
|
|
42
|
+
* Type: "private",
|
|
43
|
+
* Purpose: "internal-only"
|
|
44
|
+
* }
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Create a route table with custom timeout configuration
|
|
49
|
+
* const customRouteTable = await RouteTable("custom-routes", {
|
|
50
|
+
* vpc: myVpc,
|
|
51
|
+
* timeout: {
|
|
52
|
+
* maxAttempts: 45,
|
|
53
|
+
* delayMs: 1500
|
|
54
|
+
* },
|
|
55
|
+
* tags: {
|
|
56
|
+
* Name: "custom-timeout-route-table"
|
|
57
|
+
* }
|
|
58
|
+
* });
|
|
59
|
+
*/
|
|
60
|
+
export const RouteTable = Resource("aws::RouteTable", async function (_id, props) {
|
|
61
|
+
const client = await createEC2Client();
|
|
62
|
+
const timeoutConfig = mergeTimeoutConfig(ROUTE_TABLE_TIMEOUT, props.timeout);
|
|
63
|
+
const vpcId = typeof props.vpc === "string" ? props.vpc : props.vpc.vpcId;
|
|
64
|
+
if (this.phase === "delete") {
|
|
65
|
+
if (this.output?.routeTableId) {
|
|
66
|
+
logger.log(`🗑️ Deleting Route Table: ${this.output.routeTableId}`);
|
|
67
|
+
// Delete the Route Table
|
|
68
|
+
await ignore("InvalidRouteTableID.NotFound", async () => {
|
|
69
|
+
await callEC2Api(client, "DeleteRouteTable", parseRouteTableXmlResponse, {
|
|
70
|
+
RouteTableId: this.output.routeTableId,
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
// Wait for Route Table to be fully deleted
|
|
74
|
+
await waitForRouteTableDeleted(client, this.output.routeTableId, timeoutConfig);
|
|
75
|
+
logger.log(` ✅ Route Table ${this.output.routeTableId} deletion completed`);
|
|
76
|
+
}
|
|
77
|
+
return this.destroy();
|
|
78
|
+
}
|
|
79
|
+
let routeTable;
|
|
80
|
+
if (this.phase === "update" && this.output?.routeTableId) {
|
|
81
|
+
logger.log(`🔄 Updating Route Table: ${this.output.routeTableId}`);
|
|
82
|
+
// Get existing route table
|
|
83
|
+
const response = await callEC2Api(client, "DescribeRouteTables", parseRouteTableXmlResponse, {
|
|
84
|
+
"RouteTableId.1": this.output.routeTableId,
|
|
85
|
+
});
|
|
86
|
+
if (!response.RouteTables?.[0]) {
|
|
87
|
+
throw new Error(`Route Table ${this.output.routeTableId} not found`);
|
|
88
|
+
}
|
|
89
|
+
routeTable = response.RouteTables[0];
|
|
90
|
+
logger.log(` ✅ Route Table ${this.output.routeTableId} updated`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
logger.log(`🚀 Creating Route Table in VPC ${vpcId}`);
|
|
94
|
+
// Create new route table
|
|
95
|
+
const createRouteTableParams = {
|
|
96
|
+
VpcId: vpcId,
|
|
97
|
+
};
|
|
98
|
+
// Add tags if specified
|
|
99
|
+
if (props.tags) {
|
|
100
|
+
createRouteTableParams.TagSpecifications = [
|
|
101
|
+
{
|
|
102
|
+
ResourceType: "route-table",
|
|
103
|
+
Tags: Object.entries(props.tags).map(([key, value]) => ({
|
|
104
|
+
Key: key,
|
|
105
|
+
Value: value,
|
|
106
|
+
})),
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
const createParams = convertCreateRouteTableParamsToAwsFormat(createRouteTableParams);
|
|
111
|
+
const response = await callEC2Api(client, "CreateRouteTable", parseRouteTableXmlResponse, createParams);
|
|
112
|
+
if (!response.RouteTable) {
|
|
113
|
+
throw new Error("Failed to create route table");
|
|
114
|
+
}
|
|
115
|
+
routeTable = response.RouteTable;
|
|
116
|
+
logger.log(` ✅ Route Table ${routeTable.RouteTableId} created`);
|
|
117
|
+
}
|
|
118
|
+
return this({
|
|
119
|
+
routeTableId: routeTable.RouteTableId,
|
|
120
|
+
vpcId: routeTable.VpcId,
|
|
121
|
+
...props,
|
|
122
|
+
vpc: vpcId,
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* Route Table timeout constants
|
|
127
|
+
*/
|
|
128
|
+
export const ROUTE_TABLE_TIMEOUT = {
|
|
129
|
+
maxAttempts: 30,
|
|
130
|
+
delayMs: 1000, // 1 second - Route Tables are fast resources
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Helper functions to convert typed parameters to AWS API format
|
|
134
|
+
*/
|
|
135
|
+
function convertCreateRouteTableParamsToAwsFormat(params) {
|
|
136
|
+
const awsParams = {
|
|
137
|
+
VpcId: params.VpcId,
|
|
138
|
+
};
|
|
139
|
+
if (params.DryRun !== undefined) {
|
|
140
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
141
|
+
}
|
|
142
|
+
// Handle TagSpecifications
|
|
143
|
+
if (params.TagSpecifications) {
|
|
144
|
+
params.TagSpecifications.forEach((tagSpec, specIndex) => {
|
|
145
|
+
const specNum = specIndex + 1;
|
|
146
|
+
awsParams[`TagSpecification.${specNum}.ResourceType`] =
|
|
147
|
+
tagSpec.ResourceType;
|
|
148
|
+
tagSpec.Tags.forEach((tag, tagIndex) => {
|
|
149
|
+
const tagNum = tagIndex + 1;
|
|
150
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Key`] = tag.Key;
|
|
151
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Value`] =
|
|
152
|
+
tag.Value;
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return awsParams;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Parse XML responses specifically for Route Table operations
|
|
160
|
+
*/
|
|
161
|
+
function parseRouteTableXmlResponse(xmlText) {
|
|
162
|
+
const parser = new XMLParser({
|
|
163
|
+
ignoreAttributes: true,
|
|
164
|
+
parseAttributeValue: true,
|
|
165
|
+
parseTagValue: true,
|
|
166
|
+
trimValues: true,
|
|
167
|
+
});
|
|
168
|
+
const parsed = parser.parse(xmlText);
|
|
169
|
+
const result = {};
|
|
170
|
+
// Parse CreateRouteTableResponse
|
|
171
|
+
if (parsed.CreateRouteTableResponse) {
|
|
172
|
+
const routeTable = parsed.CreateRouteTableResponse
|
|
173
|
+
.routeTable;
|
|
174
|
+
if (routeTable) {
|
|
175
|
+
result.RouteTable = {
|
|
176
|
+
RouteTableId: routeTable.routeTableId,
|
|
177
|
+
VpcId: routeTable.vpcId,
|
|
178
|
+
Routes: routeTable.routeSet?.item
|
|
179
|
+
? (Array.isArray(routeTable.routeSet.item)
|
|
180
|
+
? routeTable.routeSet.item
|
|
181
|
+
: [routeTable.routeSet.item]).map((route) => ({
|
|
182
|
+
DestinationCidrBlock: route.destinationCidrBlock,
|
|
183
|
+
GatewayId: route.gatewayId,
|
|
184
|
+
InstanceId: route.instanceId,
|
|
185
|
+
NatGatewayId: route.natGatewayId,
|
|
186
|
+
State: route.state,
|
|
187
|
+
Origin: route.origin,
|
|
188
|
+
}))
|
|
189
|
+
: [],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Parse DescribeRouteTablesResponse
|
|
194
|
+
if (parsed.DescribeRouteTablesResponse) {
|
|
195
|
+
const routeTableSet = parsed.DescribeRouteTablesResponse.routeTableSet;
|
|
196
|
+
if (routeTableSet?.item) {
|
|
197
|
+
const routeTables = Array.isArray(routeTableSet.item)
|
|
198
|
+
? routeTableSet.item
|
|
199
|
+
: [routeTableSet.item];
|
|
200
|
+
result.RouteTables = routeTables.map((routeTable) => ({
|
|
201
|
+
RouteTableId: routeTable.routeTableId,
|
|
202
|
+
VpcId: routeTable.vpcId,
|
|
203
|
+
Routes: routeTable.routeSet?.item
|
|
204
|
+
? (Array.isArray(routeTable.routeSet.item)
|
|
205
|
+
? routeTable.routeSet.item
|
|
206
|
+
: [routeTable.routeSet.item]).map((route) => ({
|
|
207
|
+
DestinationCidrBlock: route.destinationCidrBlock,
|
|
208
|
+
GatewayId: route.gatewayId,
|
|
209
|
+
InstanceId: route.instanceId,
|
|
210
|
+
NatGatewayId: route.natGatewayId,
|
|
211
|
+
State: route.state,
|
|
212
|
+
Origin: route.origin,
|
|
213
|
+
}))
|
|
214
|
+
: [],
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
result.RouteTables = [];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
// Handle success responses
|
|
222
|
+
if (parsed.DeleteRouteTableResponse) {
|
|
223
|
+
result.success = true;
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Wait for Route Table to be deleted
|
|
229
|
+
*/
|
|
230
|
+
async function waitForRouteTableDeleted(client, routeTableId, timeoutConfig) {
|
|
231
|
+
const checkFunction = async () => {
|
|
232
|
+
try {
|
|
233
|
+
const response = await callEC2Api(client, "DescribeRouteTables", parseRouteTableXmlResponse, {
|
|
234
|
+
"RouteTableId.1": routeTableId,
|
|
235
|
+
});
|
|
236
|
+
return response.RouteTables?.[0];
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
// If Route Table is not found, it's been deleted - return undefined
|
|
240
|
+
if (error.code === "InvalidRouteTableID.NotFound" ||
|
|
241
|
+
error.code === "InvalidRouteTable.NotFound") {
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
throw error;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const isReady = (rt) => {
|
|
248
|
+
// Route Table is deleted if it doesn't exist
|
|
249
|
+
return !rt;
|
|
250
|
+
};
|
|
251
|
+
await waitForResourceState(checkFunction, isReady, timeoutConfig, routeTableId, "Route Table", "be deleted");
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=route-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-table.js","sourceRoot":"","sources":["../../../src/aws/ec2/route-table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAElB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAyCzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAChC,iBAAiB,EACjB,KAAK,WAEH,GAAW,EACX,KAAsB;IAEtB,MAAM,MAAM,GAAG,MAAM,eAAe,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,kBAAkB,CACtC,mBAAmB,EACnB,KAAK,CAAC,OAAO,CACd,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC;IAE1E,IAAI,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QA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ACH,MAAM,QAAQ,GAAG,MAAM,UAAU,CAC/B,MAAM,EACN,qBAAqB,EACrB,0BAA0B,EAC1B;gBACE,gBAAgB,EAAE,YAAY;aAC/B,CACF,CAAC;YACF,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,oEAAoE;YACpE,IACE,KAAK,CAAC,IAAI,KAAK,8BAA8B;gBAC7C,KAAK,CAAC,IAAI,KAAK,4BAA4B,EAC3C,CAAC;gBACD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,CAAC,EAA6B,EAAE,EAAE;QAChD,6CAA6C;QAC7C,OAAO,CAAC,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,MAAM,oBAAoB,CACxB,aAAa,EACb,OAAO,EACP,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { Context } from "../../context.ts";
|
|
2
|
+
import { Resource } from "../../resource.ts";
|
|
3
|
+
import { type TimeoutConfig } from "../../util/timeout.ts";
|
|
4
|
+
import type { InternetGateway } from "./internet-gateway.ts";
|
|
5
|
+
import type { NatGateway } from "./nat-gateway.ts";
|
|
6
|
+
import type { RouteTable } from "./route-table.ts";
|
|
7
|
+
/**
|
|
8
|
+
* Properties for creating or updating a Route
|
|
9
|
+
*/
|
|
10
|
+
export interface RouteProps {
|
|
11
|
+
/**
|
|
12
|
+
* The route table to add the route to
|
|
13
|
+
*/
|
|
14
|
+
routeTable: RouteTable | string;
|
|
15
|
+
/**
|
|
16
|
+
* The destination CIDR block for the route
|
|
17
|
+
* @example "0.0.0.0/0" for default route
|
|
18
|
+
*/
|
|
19
|
+
destinationCidrBlock: string;
|
|
20
|
+
/**
|
|
21
|
+
* The target for the route (one of the following)
|
|
22
|
+
*/
|
|
23
|
+
target: {
|
|
24
|
+
internetGateway: InternetGateway | string;
|
|
25
|
+
} | {
|
|
26
|
+
natGateway: NatGateway | string;
|
|
27
|
+
} | {
|
|
28
|
+
instanceId: string;
|
|
29
|
+
} | {
|
|
30
|
+
networkInterfaceId: string;
|
|
31
|
+
} | {
|
|
32
|
+
vpcPeeringConnectionId: string;
|
|
33
|
+
} | {
|
|
34
|
+
transitGatewayId: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Timeout configuration for Route operations
|
|
38
|
+
* @default Route-specific sensible defaults (30 attempts, 1000ms delay)
|
|
39
|
+
*/
|
|
40
|
+
timeout?: Partial<TimeoutConfig>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Output returned after Route creation/update
|
|
44
|
+
*/
|
|
45
|
+
export interface Route extends Resource<"aws::Route">, RouteProps {
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the route table
|
|
48
|
+
*/
|
|
49
|
+
routeTableId: string;
|
|
50
|
+
/**
|
|
51
|
+
* The current state of the route
|
|
52
|
+
*/
|
|
53
|
+
state: "active" | "blackhole";
|
|
54
|
+
/**
|
|
55
|
+
* The origin of the route
|
|
56
|
+
*/
|
|
57
|
+
origin: "CreateRouteTable" | "CreateRoute" | "EnableVgwRoutePropagation";
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* AWS Route Resource
|
|
61
|
+
*
|
|
62
|
+
* Creates and manages individual routes within route tables, directing traffic
|
|
63
|
+
* to various targets like Internet Gateways, NAT Gateways, or instances.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Create a default route to Internet Gateway
|
|
67
|
+
* const publicRoute = await Route("public-default-route", {
|
|
68
|
+
* routeTable: publicRouteTable,
|
|
69
|
+
* destinationCidrBlock: "0.0.0.0/0",
|
|
70
|
+
* target: { internetGateway: mainIgw }
|
|
71
|
+
* });
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* // Create a default route to NAT Gateway for private subnets
|
|
75
|
+
* const privateRoute = await Route("private-default-route", {
|
|
76
|
+
* routeTable: privateRouteTable,
|
|
77
|
+
* destinationCidrBlock: "0.0.0.0/0",
|
|
78
|
+
* target: { natGateway: mainNat }
|
|
79
|
+
* });
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* // Create a route to a specific instance
|
|
83
|
+
* const instanceRoute = await Route("instance-route", {
|
|
84
|
+
* routeTable: "rtb-12345678",
|
|
85
|
+
* destinationCidrBlock: "10.1.0.0/16",
|
|
86
|
+
* target: { instanceId: "i-12345678" }
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* // Create a route to a network interface
|
|
91
|
+
* const eniRoute = await Route("eni-route", {
|
|
92
|
+
* routeTable: mainRouteTable,
|
|
93
|
+
* destinationCidrBlock: "192.168.1.0/24",
|
|
94
|
+
* target: { networkInterfaceId: "eni-12345678" }
|
|
95
|
+
* });
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* // Create a route to a VPC peering connection
|
|
99
|
+
* const peeringRoute = await Route("peering-route", {
|
|
100
|
+
* routeTable: mainRouteTable,
|
|
101
|
+
* destinationCidrBlock: "10.2.0.0/16",
|
|
102
|
+
* target: { vpcPeeringConnectionId: "pcx-12345678" }
|
|
103
|
+
* });
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* // Create a route to a Transit Gateway
|
|
107
|
+
* const transitRoute = await Route("transit-route", {
|
|
108
|
+
* routeTable: mainRouteTable,
|
|
109
|
+
* destinationCidrBlock: "10.3.0.0/16",
|
|
110
|
+
* target: { transitGatewayId: "tgw-12345678" }
|
|
111
|
+
* });
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* // Create a route with custom timeout configuration
|
|
115
|
+
* const customRoute = await Route("custom-route", {
|
|
116
|
+
* routeTable: mainRouteTable,
|
|
117
|
+
* destinationCidrBlock: "172.16.0.0/16",
|
|
118
|
+
* target: { internetGateway: "igw-12345678" },
|
|
119
|
+
* timeout: {
|
|
120
|
+
* maxAttempts: 60,
|
|
121
|
+
* delayMs: 2000
|
|
122
|
+
* }
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
125
|
+
export declare const Route: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<Route>, _id: string, props: RouteProps) => Promise<Route>);
|
|
126
|
+
/**
|
|
127
|
+
* Route timeout constants
|
|
128
|
+
*/
|
|
129
|
+
export declare const ROUTE_TIMEOUT: TimeoutConfig;
|
|
130
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/aws/ec2/route.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,MAAM,EACF;QAAE,eAAe,EAAE,eAAe,GAAG,MAAM,CAAA;KAAE,GAC7C;QAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAA;KAAE,GACnC;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GACtB;QAAE,kBAAkB,EAAE,MAAM,CAAA;KAAE,GAC9B;QAAE,sBAAsB,EAAE,MAAM,CAAA;KAAE,GAClC;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,KAAM,SAAQ,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU;IAC/D;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,QAAQ,GAAG,WAAW,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,kBAAkB,GAAG,aAAa,GAAG,2BAA2B,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,KAAK,yFAGR,OAAO,CAAC,KAAK,CAAC,OACf,MAAM,SACJ,UAAU,KAChB,OAAO,CAAC,KAAK,CAAC,CAgJlB,CAAC;AAuDF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAG3B,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
import { Resource } from "../../resource.js";
|
|
3
|
+
import { ignore } from "../../util/ignore.js";
|
|
4
|
+
import { logger } from "../../util/logger.js";
|
|
5
|
+
import { mergeTimeoutConfig, waitForResourceState, } from "../../util/timeout.js";
|
|
6
|
+
import { retry } from "../retry.js";
|
|
7
|
+
import { callEC2Api, createEC2Client } from "./utils.js";
|
|
8
|
+
/**
|
|
9
|
+
* AWS Route Resource
|
|
10
|
+
*
|
|
11
|
+
* Creates and manages individual routes within route tables, directing traffic
|
|
12
|
+
* to various targets like Internet Gateways, NAT Gateways, or instances.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Create a default route to Internet Gateway
|
|
16
|
+
* const publicRoute = await Route("public-default-route", {
|
|
17
|
+
* routeTable: publicRouteTable,
|
|
18
|
+
* destinationCidrBlock: "0.0.0.0/0",
|
|
19
|
+
* target: { internetGateway: mainIgw }
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Create a default route to NAT Gateway for private subnets
|
|
24
|
+
* const privateRoute = await Route("private-default-route", {
|
|
25
|
+
* routeTable: privateRouteTable,
|
|
26
|
+
* destinationCidrBlock: "0.0.0.0/0",
|
|
27
|
+
* target: { natGateway: mainNat }
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Create a route to a specific instance
|
|
32
|
+
* const instanceRoute = await Route("instance-route", {
|
|
33
|
+
* routeTable: "rtb-12345678",
|
|
34
|
+
* destinationCidrBlock: "10.1.0.0/16",
|
|
35
|
+
* target: { instanceId: "i-12345678" }
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Create a route to a network interface
|
|
40
|
+
* const eniRoute = await Route("eni-route", {
|
|
41
|
+
* routeTable: mainRouteTable,
|
|
42
|
+
* destinationCidrBlock: "192.168.1.0/24",
|
|
43
|
+
* target: { networkInterfaceId: "eni-12345678" }
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Create a route to a VPC peering connection
|
|
48
|
+
* const peeringRoute = await Route("peering-route", {
|
|
49
|
+
* routeTable: mainRouteTable,
|
|
50
|
+
* destinationCidrBlock: "10.2.0.0/16",
|
|
51
|
+
* target: { vpcPeeringConnectionId: "pcx-12345678" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Create a route to a Transit Gateway
|
|
56
|
+
* const transitRoute = await Route("transit-route", {
|
|
57
|
+
* routeTable: mainRouteTable,
|
|
58
|
+
* destinationCidrBlock: "10.3.0.0/16",
|
|
59
|
+
* target: { transitGatewayId: "tgw-12345678" }
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* // Create a route with custom timeout configuration
|
|
64
|
+
* const customRoute = await Route("custom-route", {
|
|
65
|
+
* routeTable: mainRouteTable,
|
|
66
|
+
* destinationCidrBlock: "172.16.0.0/16",
|
|
67
|
+
* target: { internetGateway: "igw-12345678" },
|
|
68
|
+
* timeout: {
|
|
69
|
+
* maxAttempts: 60,
|
|
70
|
+
* delayMs: 2000
|
|
71
|
+
* }
|
|
72
|
+
* });
|
|
73
|
+
*/
|
|
74
|
+
export const Route = Resource("aws::Route", async function (_id, props) {
|
|
75
|
+
const client = await createEC2Client();
|
|
76
|
+
const _timeoutConfig = mergeTimeoutConfig(ROUTE_TIMEOUT, props.timeout);
|
|
77
|
+
const routeTableId = typeof props.routeTable === "string"
|
|
78
|
+
? props.routeTable
|
|
79
|
+
: props.routeTable.routeTableId;
|
|
80
|
+
if (this.phase === "delete") {
|
|
81
|
+
if (this.output?.routeTableId) {
|
|
82
|
+
logger.log(`🗑️ Deleting Route: ${this.output.destinationCidrBlock} from Route Table ${this.output.routeTableId}`);
|
|
83
|
+
await retry(async () => {
|
|
84
|
+
await ignore("InvalidRoute.NotFound", async () => {
|
|
85
|
+
await callEC2Api(client, "DeleteRoute", parseRouteXmlResponse, {
|
|
86
|
+
RouteTableId: this.output.routeTableId,
|
|
87
|
+
DestinationCidrBlock: this.output.destinationCidrBlock,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
// Wait for route to be fully deleted
|
|
92
|
+
logger.log(` Waiting for Route ${this.output.destinationCidrBlock} to be fully deleted...`);
|
|
93
|
+
await waitForRouteDeleted(client, this.output.routeTableId, this.output.destinationCidrBlock, _timeoutConfig);
|
|
94
|
+
logger.log(` ✅ Route ${this.output.destinationCidrBlock} deletion completed`);
|
|
95
|
+
}
|
|
96
|
+
return this.destroy();
|
|
97
|
+
}
|
|
98
|
+
// Prepare route parameters
|
|
99
|
+
const routeParams = {
|
|
100
|
+
RouteTableId: routeTableId,
|
|
101
|
+
DestinationCidrBlock: props.destinationCidrBlock,
|
|
102
|
+
};
|
|
103
|
+
// Set the target based on the type
|
|
104
|
+
if ("internetGateway" in props.target) {
|
|
105
|
+
const igwId = typeof props.target.internetGateway === "string"
|
|
106
|
+
? props.target.internetGateway
|
|
107
|
+
: props.target.internetGateway.internetGatewayId;
|
|
108
|
+
routeParams.GatewayId = igwId;
|
|
109
|
+
}
|
|
110
|
+
else if ("natGateway" in props.target) {
|
|
111
|
+
const natId = typeof props.target.natGateway === "string"
|
|
112
|
+
? props.target.natGateway
|
|
113
|
+
: props.target.natGateway.natGatewayId;
|
|
114
|
+
routeParams.NatGatewayId = natId;
|
|
115
|
+
}
|
|
116
|
+
else if ("instanceId" in props.target) {
|
|
117
|
+
routeParams.InstanceId = props.target.instanceId;
|
|
118
|
+
}
|
|
119
|
+
else if ("networkInterfaceId" in props.target) {
|
|
120
|
+
routeParams.NetworkInterfaceId = props.target.networkInterfaceId;
|
|
121
|
+
}
|
|
122
|
+
else if ("vpcPeeringConnectionId" in props.target) {
|
|
123
|
+
routeParams.VpcPeeringConnectionId = props.target.vpcPeeringConnectionId;
|
|
124
|
+
}
|
|
125
|
+
else if ("transitGatewayId" in props.target) {
|
|
126
|
+
routeParams.TransitGatewayId = props.target.transitGatewayId;
|
|
127
|
+
}
|
|
128
|
+
if (this.phase === "update" && this.output?.routeTableId) {
|
|
129
|
+
// Check if route exists
|
|
130
|
+
const response = await callEC2Api(client, "DescribeRouteTables", parseRouteXmlResponse, {
|
|
131
|
+
"RouteTableId.1": routeTableId,
|
|
132
|
+
});
|
|
133
|
+
const routeTable = response.RouteTables?.[0];
|
|
134
|
+
const existingRoute = routeTable?.Routes?.find((r) => r.DestinationCidrBlock === props.destinationCidrBlock);
|
|
135
|
+
if (existingRoute) {
|
|
136
|
+
// Replace existing route
|
|
137
|
+
await callEC2Api(client, "ReplaceRoute", parseRouteXmlResponse, routeParams);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Create new route
|
|
141
|
+
await callEC2Api(client, "CreateRoute", parseRouteXmlResponse, routeParams);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// Create new route
|
|
146
|
+
await callEC2Api(client, "CreateRoute", parseRouteXmlResponse, routeParams);
|
|
147
|
+
}
|
|
148
|
+
// Wait a moment for the route to be fully created
|
|
149
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
150
|
+
// Get the created/updated route to return current state
|
|
151
|
+
const response = await callEC2Api(client, "DescribeRouteTables", parseRouteXmlResponse, {
|
|
152
|
+
"RouteTableId.1": routeTableId,
|
|
153
|
+
});
|
|
154
|
+
const routeTable = response.RouteTables?.[0];
|
|
155
|
+
const route = routeTable?.Routes?.find((r) => r.DestinationCidrBlock === props.destinationCidrBlock);
|
|
156
|
+
if (!route) {
|
|
157
|
+
throw new Error("Failed to find created route");
|
|
158
|
+
}
|
|
159
|
+
return this({
|
|
160
|
+
routeTableId,
|
|
161
|
+
state: route.State,
|
|
162
|
+
origin: route.Origin,
|
|
163
|
+
...props,
|
|
164
|
+
routeTable: routeTableId,
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* Wait for Route to be deleted
|
|
169
|
+
*/
|
|
170
|
+
async function waitForRouteDeleted(client, routeTableId, destinationCidrBlock, timeoutConfig) {
|
|
171
|
+
const checkFunction = async () => {
|
|
172
|
+
try {
|
|
173
|
+
const response = await callEC2Api(client, "DescribeRouteTables", parseRouteXmlResponse, {
|
|
174
|
+
"RouteTableId.1": routeTableId,
|
|
175
|
+
});
|
|
176
|
+
const routeTable = response.RouteTables?.[0];
|
|
177
|
+
const route = routeTable?.Routes?.find((r) => r.DestinationCidrBlock === destinationCidrBlock);
|
|
178
|
+
return route;
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
// If route table is not found, route is definitely deleted
|
|
182
|
+
if (error.code === "InvalidRouteTableID.NotFound" ||
|
|
183
|
+
error.code === "InvalidRouteTable.NotFound") {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
throw error;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const isReady = (route) => {
|
|
190
|
+
// Route is deleted if it doesn't exist
|
|
191
|
+
return !route;
|
|
192
|
+
};
|
|
193
|
+
await waitForResourceState(checkFunction, isReady, timeoutConfig, `${routeTableId}/${destinationCidrBlock}`, "Route", "be deleted");
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Route timeout constants
|
|
197
|
+
*/
|
|
198
|
+
export const ROUTE_TIMEOUT = {
|
|
199
|
+
maxAttempts: 30,
|
|
200
|
+
delayMs: 1000, // 1 second - Routes are fast resources
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Parse XML responses specifically for Route operations
|
|
204
|
+
*/
|
|
205
|
+
function parseRouteXmlResponse(xmlText) {
|
|
206
|
+
const parser = new XMLParser({
|
|
207
|
+
ignoreAttributes: true,
|
|
208
|
+
parseAttributeValue: true,
|
|
209
|
+
parseTagValue: true,
|
|
210
|
+
trimValues: true,
|
|
211
|
+
});
|
|
212
|
+
const parsed = parser.parse(xmlText);
|
|
213
|
+
const result = {};
|
|
214
|
+
// Parse DescribeRouteTablesResponse
|
|
215
|
+
if (parsed.DescribeRouteTablesResponse) {
|
|
216
|
+
const routeTableSet = parsed.DescribeRouteTablesResponse.routeTableSet;
|
|
217
|
+
if (routeTableSet?.item) {
|
|
218
|
+
const routeTables = Array.isArray(routeTableSet.item)
|
|
219
|
+
? routeTableSet.item
|
|
220
|
+
: [routeTableSet.item];
|
|
221
|
+
result.RouteTables = routeTables.map((rt) => ({
|
|
222
|
+
RouteTableId: rt.routeTableId,
|
|
223
|
+
VpcId: rt.vpcId,
|
|
224
|
+
Routes: rt.routeSet?.item
|
|
225
|
+
? (Array.isArray(rt.routeSet.item)
|
|
226
|
+
? rt.routeSet.item
|
|
227
|
+
: [rt.routeSet.item]).map((route) => ({
|
|
228
|
+
DestinationCidrBlock: route.destinationCidrBlock,
|
|
229
|
+
GatewayId: route.gatewayId,
|
|
230
|
+
InstanceId: route.instanceId,
|
|
231
|
+
NetworkInterfaceId: route.networkInterfaceId,
|
|
232
|
+
VpcPeeringConnectionId: route.vpcPeeringConnectionId,
|
|
233
|
+
NatGatewayId: route.natGatewayId,
|
|
234
|
+
TransitGatewayId: route.transitGatewayId,
|
|
235
|
+
State: route.state,
|
|
236
|
+
Origin: route.origin,
|
|
237
|
+
}))
|
|
238
|
+
: [],
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
result.RouteTables = [];
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Handle success responses
|
|
246
|
+
if (parsed.CreateRouteResponse ||
|
|
247
|
+
parsed.ReplaceRouteResponse ||
|
|
248
|
+
parsed.DeleteRouteResponse) {
|
|
249
|
+
result.success = true;
|
|
250
|
+
}
|
|
251
|
+
return result;
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../../../src/aws/ec2/route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAElB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIpC,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuDzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,QA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