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,618 @@
|
|
|
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 NAT Gateway Resource
|
|
9
|
+
*
|
|
10
|
+
* Creates and manages NAT Gateways that provide outbound internet access
|
|
11
|
+
* for instances in private subnets. Automatically allocates an Elastic IP
|
|
12
|
+
* if one is not provided. NAT Gateways are slow resources that can take
|
|
13
|
+
* up to 10 minutes to become available.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Create a NAT Gateway with automatic Elastic IP allocation
|
|
17
|
+
* const natGateway = await NatGateway("main-nat", {
|
|
18
|
+
* subnet: publicSubnet,
|
|
19
|
+
* tags: {
|
|
20
|
+
* Name: "main-nat-gateway",
|
|
21
|
+
* Environment: "production"
|
|
22
|
+
* }
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Create a NAT Gateway with existing Elastic IP
|
|
27
|
+
* const natGateway = await NatGateway("custom-nat", {
|
|
28
|
+
* subnet: "subnet-12345678",
|
|
29
|
+
* allocationId: "eipalloc-12345678",
|
|
30
|
+
* connectivityType: "public",
|
|
31
|
+
* tags: {
|
|
32
|
+
* Name: "custom-nat-gateway"
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Create a private NAT Gateway (for VPC-to-VPC communication)
|
|
38
|
+
* const privateNat = await NatGateway("private-nat", {
|
|
39
|
+
* subnet: privateSubnet,
|
|
40
|
+
* connectivityType: "private",
|
|
41
|
+
* tags: {
|
|
42
|
+
* Name: "private-nat-gateway",
|
|
43
|
+
* Type: "internal"
|
|
44
|
+
* }
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Create a NAT Gateway with custom timeout configuration
|
|
49
|
+
* const slowNat = await NatGateway("slow-nat", {
|
|
50
|
+
* subnet: publicSubnet,
|
|
51
|
+
* timeout: {
|
|
52
|
+
* maxAttempts: 180, // Wait up to 15 minutes
|
|
53
|
+
* delayMs: 5000 // Check every 5 seconds
|
|
54
|
+
* },
|
|
55
|
+
* tags: {
|
|
56
|
+
* Name: "slow-nat-gateway"
|
|
57
|
+
* }
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Use NAT Gateway in route table for private subnet internet access
|
|
62
|
+
* const privateRoute = await Route("private-internet", {
|
|
63
|
+
* routeTable: privateRouteTable,
|
|
64
|
+
* destinationCidrBlock: "0.0.0.0/0",
|
|
65
|
+
* natGateway: natGateway,
|
|
66
|
+
* tags: {
|
|
67
|
+
* Name: "private-to-internet"
|
|
68
|
+
* }
|
|
69
|
+
* });
|
|
70
|
+
*/
|
|
71
|
+
export const NatGateway = Resource("aws::NatGateway", async function (_id, props) {
|
|
72
|
+
const subnetId = typeof props.subnet === "string" ? props.subnet : props.subnet.subnetId;
|
|
73
|
+
const timeoutConfig = mergeTimeoutConfig(NAT_GATEWAY_TIMEOUT, props.timeout);
|
|
74
|
+
if (this.phase === "delete") {
|
|
75
|
+
if (this.output?.natGatewayId) {
|
|
76
|
+
logger.log(`🗑️ Deleting NAT Gateway: ${this.output.natGatewayId}`);
|
|
77
|
+
// Delete NAT Gateway if it exists
|
|
78
|
+
await ignore("InvalidNatGatewayID.NotFound", async () => {
|
|
79
|
+
const client = await createEC2Client();
|
|
80
|
+
await callEC2Api(client, "DeleteNatGateway", parseNatGatewayXmlResponse, convertDeleteNatGatewayParamsToAwsFormat({
|
|
81
|
+
NatGatewayId: this.output.natGatewayId,
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
// Wait for NAT Gateway to be deleted AND network interfaces to be cleaned up
|
|
85
|
+
logger.log(` Waiting for NAT Gateway ${this.output.natGatewayId} to be fully deleted...`);
|
|
86
|
+
await waitForNatGatewayFullyDeleted(this.output.natGatewayId, timeoutConfig);
|
|
87
|
+
logger.log(` ✅ NAT Gateway ${this.output.natGatewayId} deletion completed`);
|
|
88
|
+
// Release Elastic IP if we created it and it exists
|
|
89
|
+
if (this.output.createdElasticIp && this.output.allocationId) {
|
|
90
|
+
logger.log(` Releasing Elastic IP: ${this.output.allocationId}`);
|
|
91
|
+
await ignore(["InvalidAllocationID.NotFound", "InvalidAddress.NotFound"], async () => {
|
|
92
|
+
const eipClient = await createEC2Client();
|
|
93
|
+
await callEC2Api(eipClient, "ReleaseAddress", parseNatGatewayXmlResponse, convertReleaseAddressParamsToAwsFormat({
|
|
94
|
+
AllocationId: this.output.allocationId,
|
|
95
|
+
}));
|
|
96
|
+
});
|
|
97
|
+
// Wait for the EIP to be fully released
|
|
98
|
+
await waitForEipReleased(this.output.allocationId, timeoutConfig);
|
|
99
|
+
logger.log(` ✅ Elastic IP ${this.output.allocationId} released successfully`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return this.destroy();
|
|
103
|
+
}
|
|
104
|
+
let natGateway;
|
|
105
|
+
let allocationId = props.allocationId;
|
|
106
|
+
let createdElasticIp = false;
|
|
107
|
+
let publicIp;
|
|
108
|
+
if (this.phase === "update" && this.output?.natGatewayId) {
|
|
109
|
+
// Get existing NAT Gateway
|
|
110
|
+
const client = await createEC2Client();
|
|
111
|
+
const response = await callEC2Api(client, "DescribeNatGateways", parseNatGatewayXmlResponse, convertDescribeNatGatewaysParamsToAwsFormat({
|
|
112
|
+
NatGatewayIds: [this.output.natGatewayId],
|
|
113
|
+
}));
|
|
114
|
+
if (!response.NatGateways?.[0]) {
|
|
115
|
+
throw new Error(`NAT Gateway ${this.output.natGatewayId} not found`);
|
|
116
|
+
}
|
|
117
|
+
natGateway = response.NatGateways[0];
|
|
118
|
+
allocationId = this.output.allocationId;
|
|
119
|
+
createdElasticIp = this.output.createdElasticIp;
|
|
120
|
+
publicIp = this.output.publicIp;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Allocate Elastic IP if not provided
|
|
124
|
+
if (!allocationId) {
|
|
125
|
+
const eipParams = {
|
|
126
|
+
Domain: "vpc",
|
|
127
|
+
};
|
|
128
|
+
// Add tags if specified
|
|
129
|
+
if (props.tags) {
|
|
130
|
+
eipParams.TagSpecifications = [
|
|
131
|
+
{
|
|
132
|
+
ResourceType: "elastic-ip",
|
|
133
|
+
Tags: Object.entries(props.tags).map(([key, value]) => ({
|
|
134
|
+
Key: `${key}-eip`,
|
|
135
|
+
Value: value,
|
|
136
|
+
})),
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
const client = await createEC2Client();
|
|
141
|
+
const eipResponse = await callEC2Api(client, "AllocateAddress", parseNatGatewayXmlResponse, convertAllocateAddressParamsToAwsFormat(eipParams));
|
|
142
|
+
if (!eipResponse.AllocationId) {
|
|
143
|
+
throw new Error("Failed to allocate Elastic IP");
|
|
144
|
+
}
|
|
145
|
+
allocationId = eipResponse.AllocationId;
|
|
146
|
+
publicIp = eipResponse.PublicIp;
|
|
147
|
+
createdElasticIp = true;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
// Get public IP of existing allocation
|
|
151
|
+
const client = await createEC2Client();
|
|
152
|
+
const addressResponse = await callEC2Api(client, "DescribeAddresses", parseNatGatewayXmlResponse, convertDescribeAddressesParamsToAwsFormat({
|
|
153
|
+
AllocationIds: [allocationId],
|
|
154
|
+
}));
|
|
155
|
+
publicIp = addressResponse.Addresses?.[0]?.PublicIp;
|
|
156
|
+
}
|
|
157
|
+
// Create NAT Gateway
|
|
158
|
+
const createParams = {
|
|
159
|
+
SubnetId: subnetId,
|
|
160
|
+
AllocationId: allocationId,
|
|
161
|
+
ConnectivityType: props.connectivityType || "public",
|
|
162
|
+
};
|
|
163
|
+
// Add tags if specified
|
|
164
|
+
if (props.tags) {
|
|
165
|
+
createParams.TagSpecifications = [
|
|
166
|
+
{
|
|
167
|
+
ResourceType: "natgateway",
|
|
168
|
+
Tags: Object.entries(props.tags).map(([key, value]) => ({
|
|
169
|
+
Key: key,
|
|
170
|
+
Value: value,
|
|
171
|
+
})),
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
const natClient = await createEC2Client();
|
|
176
|
+
const response = await callEC2Api(natClient, "CreateNatGateway", parseNatGatewayXmlResponse, convertCreateNatGatewayParamsToAwsFormat(createParams));
|
|
177
|
+
if (!response.NatGateway) {
|
|
178
|
+
throw new Error("Failed to create NAT Gateway");
|
|
179
|
+
}
|
|
180
|
+
natGateway = response.NatGateway;
|
|
181
|
+
// Wait for NAT Gateway to be available
|
|
182
|
+
await waitForNatGatewayAvailable(natGateway.NatGatewayId, timeoutConfig);
|
|
183
|
+
}
|
|
184
|
+
const result = this({
|
|
185
|
+
natGatewayId: natGateway.NatGatewayId,
|
|
186
|
+
subnetId: natGateway.SubnetId,
|
|
187
|
+
vpcId: natGateway.VpcId,
|
|
188
|
+
state: natGateway.State,
|
|
189
|
+
allocationId: allocationId,
|
|
190
|
+
publicIp,
|
|
191
|
+
privateIp: natGateway.NatGatewayAddresses?.[0]?.PrivateIp,
|
|
192
|
+
createdElasticIp,
|
|
193
|
+
...props,
|
|
194
|
+
subnet: subnetId,
|
|
195
|
+
});
|
|
196
|
+
return result;
|
|
197
|
+
});
|
|
198
|
+
/**
|
|
199
|
+
* Wait for NAT Gateway to be in available state
|
|
200
|
+
*/
|
|
201
|
+
async function waitForNatGatewayAvailable(natGatewayId, timeoutConfig) {
|
|
202
|
+
const checkFunction = async () => {
|
|
203
|
+
const client = await createEC2Client();
|
|
204
|
+
const response = await callEC2Api(client, "DescribeNatGateways", parseNatGatewayXmlResponse, convertDescribeNatGatewaysParamsToAwsFormat({
|
|
205
|
+
NatGatewayIds: [natGatewayId],
|
|
206
|
+
}));
|
|
207
|
+
return response.NatGateways?.[0];
|
|
208
|
+
};
|
|
209
|
+
const isReady = (natGateway) => {
|
|
210
|
+
// Check for non-retryable failure states
|
|
211
|
+
if (natGateway?.State === "failed") {
|
|
212
|
+
throw new NatGatewayNonRetryableError(`NAT Gateway ${natGatewayId} failed to create`);
|
|
213
|
+
}
|
|
214
|
+
return natGateway?.State === "available";
|
|
215
|
+
};
|
|
216
|
+
await waitForResourceState(checkFunction, isReady, timeoutConfig, natGatewayId, "NAT Gateway", "is now available");
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Wait for NAT Gateway to be deleted
|
|
220
|
+
*/
|
|
221
|
+
async function waitForNatGatewayDeleted(natGatewayId, timeoutConfig) {
|
|
222
|
+
const checkFunction = async () => {
|
|
223
|
+
try {
|
|
224
|
+
const client = await createEC2Client();
|
|
225
|
+
const response = await callEC2Api(client, "DescribeNatGateways", parseNatGatewayXmlResponse, convertDescribeNatGatewaysParamsToAwsFormat({
|
|
226
|
+
NatGatewayIds: [natGatewayId],
|
|
227
|
+
}));
|
|
228
|
+
return response.NatGateways?.[0];
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
// If NAT Gateway is not found, it's been deleted - return undefined
|
|
232
|
+
if (error.code === "InvalidNatGatewayID.NotFound" ||
|
|
233
|
+
error.code === "InvalidNatGateway.NotFound" ||
|
|
234
|
+
error.code === "NatGatewayNotFound") {
|
|
235
|
+
return undefined;
|
|
236
|
+
}
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const isReady = (natGateway) => {
|
|
241
|
+
// NAT Gateway is deleted if it doesn't exist or is in deleted state
|
|
242
|
+
return !natGateway || natGateway.State === "deleted";
|
|
243
|
+
};
|
|
244
|
+
await waitForResourceState(checkFunction, isReady, timeoutConfig, natGatewayId, "NAT Gateway", "deletion completed");
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Parse XML response for DescribeNetworkInterfaces
|
|
248
|
+
*/
|
|
249
|
+
function parseDescribeNetworkInterfacesResponse(xmlText) {
|
|
250
|
+
const parser = new XMLParser({
|
|
251
|
+
ignoreAttributes: true,
|
|
252
|
+
parseAttributeValue: true,
|
|
253
|
+
parseTagValue: true,
|
|
254
|
+
trimValues: true,
|
|
255
|
+
});
|
|
256
|
+
const parsed = parser.parse(xmlText);
|
|
257
|
+
const result = { NetworkInterfaces: [] };
|
|
258
|
+
if (parsed.DescribeNetworkInterfacesResponse) {
|
|
259
|
+
const networkInterfaceSet = parsed.DescribeNetworkInterfacesResponse.networkInterfaceSet;
|
|
260
|
+
if (networkInterfaceSet?.item) {
|
|
261
|
+
const items = Array.isArray(networkInterfaceSet.item)
|
|
262
|
+
? networkInterfaceSet.item
|
|
263
|
+
: [networkInterfaceSet.item];
|
|
264
|
+
result.NetworkInterfaces = items.map((item) => ({
|
|
265
|
+
NetworkInterfaceId: item.networkInterfaceId,
|
|
266
|
+
Description: item.description,
|
|
267
|
+
Status: item.status,
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return result;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Wait for an Elastic IP to be released.
|
|
275
|
+
*/
|
|
276
|
+
async function waitForEipReleased(allocationId, timeoutConfig) {
|
|
277
|
+
const checkFunction = async () => {
|
|
278
|
+
try {
|
|
279
|
+
const eipClient = await createEC2Client();
|
|
280
|
+
const addressResponse = await callEC2Api(eipClient, "DescribeAddresses", parseNatGatewayXmlResponse, convertDescribeAddressesParamsToAwsFormat({
|
|
281
|
+
AllocationIds: [allocationId],
|
|
282
|
+
}));
|
|
283
|
+
return addressResponse.Addresses?.[0];
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
if (error.code === "InvalidAllocationID.NotFound" ||
|
|
287
|
+
error.code === "InvalidAddress.NotFound") {
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const isReady = (address) => {
|
|
294
|
+
return !address;
|
|
295
|
+
};
|
|
296
|
+
await waitForResourceState(checkFunction, isReady, timeoutConfig, allocationId, "Elastic IP", "to be released");
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Wait for NAT Gateway to be fully deleted including network interface cleanup
|
|
300
|
+
*/
|
|
301
|
+
async function waitForNatGatewayFullyDeleted(natGatewayId, timeoutConfig) {
|
|
302
|
+
// First wait for the NAT Gateway itself to be deleted
|
|
303
|
+
await waitForNatGatewayDeleted(natGatewayId, timeoutConfig);
|
|
304
|
+
// Then wait for network interfaces to be cleaned up
|
|
305
|
+
const checkNetworkInterfaces = async () => {
|
|
306
|
+
try {
|
|
307
|
+
const client = await createEC2Client();
|
|
308
|
+
const response = await callEC2Api(client, "DescribeNetworkInterfaces", parseDescribeNetworkInterfacesResponse, {
|
|
309
|
+
"Filter.1.Name": "description",
|
|
310
|
+
"Filter.1.Value.1": `Interface for NAT Gateway ${natGatewayId}`,
|
|
311
|
+
});
|
|
312
|
+
return response.NetworkInterfaces || [];
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
// If we can't check network interfaces, assume cleanup is complete
|
|
316
|
+
logger.log(` Could not check network interfaces for NAT Gateway ${natGatewayId}, assuming cleanup complete`, error);
|
|
317
|
+
return [];
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const isNetworkInterfacesCleanedUp = (networkInterfaces) => {
|
|
321
|
+
if (networkInterfaces.length > 0) {
|
|
322
|
+
logger.log(` NAT Gateway ${natGatewayId} still has ${networkInterfaces.length} network interfaces, waiting for cleanup...`);
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
return true;
|
|
326
|
+
};
|
|
327
|
+
await waitForResourceState(checkNetworkInterfaces, isNetworkInterfacesCleanedUp, timeoutConfig, natGatewayId, "NAT Gateway network interfaces", "cleanup completed");
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Non-retryable error for NAT Gateway operations
|
|
331
|
+
*/
|
|
332
|
+
export class NatGatewayNonRetryableError extends Error {
|
|
333
|
+
constructor(message) {
|
|
334
|
+
super(message);
|
|
335
|
+
this.name = "NatGatewayNonRetryableError";
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* NAT Gateway timeout constants
|
|
340
|
+
*/
|
|
341
|
+
export const NAT_GATEWAY_TIMEOUT = {
|
|
342
|
+
maxAttempts: 120, // NAT Gateways are slow resources - can take up to 10 minutes
|
|
343
|
+
delayMs: 5000, // Check every 5 seconds
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Parse XML responses specifically for NAT Gateway operations
|
|
347
|
+
*/
|
|
348
|
+
function parseNatGatewayXmlResponse(xmlText) {
|
|
349
|
+
const parser = new XMLParser({
|
|
350
|
+
ignoreAttributes: true,
|
|
351
|
+
parseAttributeValue: true,
|
|
352
|
+
parseTagValue: true,
|
|
353
|
+
trimValues: true,
|
|
354
|
+
});
|
|
355
|
+
const parsed = parser.parse(xmlText);
|
|
356
|
+
const result = {};
|
|
357
|
+
// Parse CreateNatGatewayResponse
|
|
358
|
+
if (parsed.CreateNatGatewayResponse) {
|
|
359
|
+
const natGateway = parsed.CreateNatGatewayResponse
|
|
360
|
+
.natGateway;
|
|
361
|
+
if (natGateway) {
|
|
362
|
+
const addresses = natGateway.natGatewayAddressSet?.item
|
|
363
|
+
? Array.isArray(natGateway.natGatewayAddressSet.item)
|
|
364
|
+
? natGateway.natGatewayAddressSet.item
|
|
365
|
+
: [natGateway.natGatewayAddressSet.item]
|
|
366
|
+
: [];
|
|
367
|
+
const tags = natGateway.tagSet?.item
|
|
368
|
+
? Array.isArray(natGateway.tagSet.item)
|
|
369
|
+
? natGateway.tagSet.item
|
|
370
|
+
: [natGateway.tagSet.item]
|
|
371
|
+
: [];
|
|
372
|
+
result.NatGateway = {
|
|
373
|
+
NatGatewayId: natGateway.natGatewayId,
|
|
374
|
+
SubnetId: natGateway.subnetId,
|
|
375
|
+
VpcId: natGateway.vpcId,
|
|
376
|
+
State: natGateway.state,
|
|
377
|
+
ConnectivityType: natGateway.connectivityType,
|
|
378
|
+
NatGatewayAddresses: addresses.map((address) => ({
|
|
379
|
+
AllocationId: address.allocationId,
|
|
380
|
+
NetworkInterfaceId: address.networkInterfaceId,
|
|
381
|
+
PrivateIp: address.privateIp,
|
|
382
|
+
PublicIp: address.publicIp,
|
|
383
|
+
})),
|
|
384
|
+
Tags: tags.map((tag) => ({
|
|
385
|
+
Key: tag.key,
|
|
386
|
+
Value: tag.value,
|
|
387
|
+
})),
|
|
388
|
+
CreateTime: natGateway.createTime,
|
|
389
|
+
DeleteTime: natGateway.deleteTime,
|
|
390
|
+
FailureCode: natGateway.failureCode,
|
|
391
|
+
FailureMessage: natGateway.failureMessage,
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
// Parse DescribeNatGatewaysResponse
|
|
396
|
+
if (parsed.DescribeNatGatewaysResponse) {
|
|
397
|
+
const natGatewaySet = parsed.DescribeNatGatewaysResponse.natGatewaySet;
|
|
398
|
+
if (natGatewaySet?.item) {
|
|
399
|
+
const natGateways = Array.isArray(natGatewaySet.item)
|
|
400
|
+
? natGatewaySet.item
|
|
401
|
+
: [natGatewaySet.item];
|
|
402
|
+
result.NatGateways = natGateways.map((natGateway) => {
|
|
403
|
+
const addresses = natGateway.natGatewayAddressSet?.item
|
|
404
|
+
? Array.isArray(natGateway.natGatewayAddressSet.item)
|
|
405
|
+
? natGateway.natGatewayAddressSet.item
|
|
406
|
+
: [natGateway.natGatewayAddressSet.item]
|
|
407
|
+
: [];
|
|
408
|
+
const tags = natGateway.tagSet?.item
|
|
409
|
+
? Array.isArray(natGateway.tagSet.item)
|
|
410
|
+
? natGateway.tagSet.item
|
|
411
|
+
: [natGateway.tagSet.item]
|
|
412
|
+
: [];
|
|
413
|
+
return {
|
|
414
|
+
NatGatewayId: natGateway.natGatewayId,
|
|
415
|
+
SubnetId: natGateway.subnetId,
|
|
416
|
+
VpcId: natGateway.vpcId,
|
|
417
|
+
State: natGateway.state,
|
|
418
|
+
ConnectivityType: natGateway.connectivityType,
|
|
419
|
+
NatGatewayAddresses: addresses.map((address) => ({
|
|
420
|
+
AllocationId: address.allocationId,
|
|
421
|
+
NetworkInterfaceId: address.networkInterfaceId,
|
|
422
|
+
PrivateIp: address.privateIp,
|
|
423
|
+
PublicIp: address.publicIp,
|
|
424
|
+
})),
|
|
425
|
+
Tags: tags.map((tag) => ({
|
|
426
|
+
Key: tag.key,
|
|
427
|
+
Value: tag.value,
|
|
428
|
+
})),
|
|
429
|
+
CreateTime: natGateway.createTime,
|
|
430
|
+
DeleteTime: natGateway.deleteTime,
|
|
431
|
+
FailureCode: natGateway.failureCode,
|
|
432
|
+
FailureMessage: natGateway.failureMessage,
|
|
433
|
+
};
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
result.NatGateways = [];
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
// Parse AllocateAddressResponse (for EIP allocation)
|
|
441
|
+
if (parsed.AllocateAddressResponse) {
|
|
442
|
+
result.AllocationId = parsed.AllocateAddressResponse.allocationId;
|
|
443
|
+
result.PublicIp = parsed.AllocateAddressResponse.publicIp;
|
|
444
|
+
}
|
|
445
|
+
// Parse DescribeAddressesResponse (for EIP lookup)
|
|
446
|
+
if (parsed.DescribeAddressesResponse) {
|
|
447
|
+
const addressesSet = parsed.DescribeAddressesResponse.addressesSet;
|
|
448
|
+
if (addressesSet?.item) {
|
|
449
|
+
const addresses = Array.isArray(addressesSet.item)
|
|
450
|
+
? addressesSet.item
|
|
451
|
+
: [addressesSet.item];
|
|
452
|
+
result.Addresses = addresses.map((address) => ({
|
|
453
|
+
AllocationId: address.allocationId,
|
|
454
|
+
PublicIp: address.publicIp,
|
|
455
|
+
PrivateIpAddress: address.privateIpAddress,
|
|
456
|
+
Domain: address.domain,
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
result.Addresses = [];
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
// Handle success responses
|
|
464
|
+
if (parsed.DeleteNatGatewayResponse || parsed.ReleaseAddressResponse) {
|
|
465
|
+
result.success = true;
|
|
466
|
+
}
|
|
467
|
+
return result;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Helper functions to convert typed parameters to AWS API format
|
|
471
|
+
*/
|
|
472
|
+
function convertCreateNatGatewayParamsToAwsFormat(params) {
|
|
473
|
+
const awsParams = {
|
|
474
|
+
SubnetId: params.SubnetId,
|
|
475
|
+
};
|
|
476
|
+
if (params.AllocationId !== undefined) {
|
|
477
|
+
awsParams.AllocationId = params.AllocationId;
|
|
478
|
+
}
|
|
479
|
+
if (params.ConnectivityType !== undefined) {
|
|
480
|
+
awsParams.ConnectivityType = params.ConnectivityType;
|
|
481
|
+
}
|
|
482
|
+
if (params.DryRun !== undefined) {
|
|
483
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
484
|
+
}
|
|
485
|
+
if (params.ClientToken !== undefined) {
|
|
486
|
+
awsParams.ClientToken = params.ClientToken;
|
|
487
|
+
}
|
|
488
|
+
// Handle TagSpecifications
|
|
489
|
+
if (params.TagSpecifications) {
|
|
490
|
+
params.TagSpecifications.forEach((tagSpec, specIndex) => {
|
|
491
|
+
const specNum = specIndex + 1;
|
|
492
|
+
awsParams[`TagSpecification.${specNum}.ResourceType`] =
|
|
493
|
+
tagSpec.ResourceType;
|
|
494
|
+
tagSpec.Tags.forEach((tag, tagIndex) => {
|
|
495
|
+
const tagNum = tagIndex + 1;
|
|
496
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Key`] = tag.Key;
|
|
497
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Value`] =
|
|
498
|
+
tag.Value;
|
|
499
|
+
});
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
return awsParams;
|
|
503
|
+
}
|
|
504
|
+
function convertDescribeNatGatewaysParamsToAwsFormat(params) {
|
|
505
|
+
const awsParams = {};
|
|
506
|
+
if (params.NatGatewayIds) {
|
|
507
|
+
params.NatGatewayIds.forEach((id, index) => {
|
|
508
|
+
awsParams[`NatGatewayId.${index + 1}`] = id;
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
if (params.Filters) {
|
|
512
|
+
params.Filters.forEach((filter, filterIndex) => {
|
|
513
|
+
const filterNum = filterIndex + 1;
|
|
514
|
+
awsParams[`Filter.${filterNum}.Name`] = filter.Name;
|
|
515
|
+
filter.Values.forEach((value, valueIndex) => {
|
|
516
|
+
awsParams[`Filter.${filterNum}.Value.${valueIndex + 1}`] = value;
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
if (params.NextToken !== undefined) {
|
|
521
|
+
awsParams.NextToken = params.NextToken;
|
|
522
|
+
}
|
|
523
|
+
if (params.MaxResults !== undefined) {
|
|
524
|
+
awsParams.MaxResults = params.MaxResults.toString();
|
|
525
|
+
}
|
|
526
|
+
if (params.DryRun !== undefined) {
|
|
527
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
528
|
+
}
|
|
529
|
+
return awsParams;
|
|
530
|
+
}
|
|
531
|
+
function convertDeleteNatGatewayParamsToAwsFormat(params) {
|
|
532
|
+
const awsParams = {
|
|
533
|
+
NatGatewayId: params.NatGatewayId,
|
|
534
|
+
};
|
|
535
|
+
if (params.DryRun !== undefined) {
|
|
536
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
537
|
+
}
|
|
538
|
+
return awsParams;
|
|
539
|
+
}
|
|
540
|
+
function convertAllocateAddressParamsToAwsFormat(params) {
|
|
541
|
+
const awsParams = {};
|
|
542
|
+
if (params.Domain !== undefined) {
|
|
543
|
+
awsParams.Domain = params.Domain;
|
|
544
|
+
}
|
|
545
|
+
if (params.Address !== undefined) {
|
|
546
|
+
awsParams.Address = params.Address;
|
|
547
|
+
}
|
|
548
|
+
if (params.PublicIpv4Pool !== undefined) {
|
|
549
|
+
awsParams.PublicIpv4Pool = params.PublicIpv4Pool;
|
|
550
|
+
}
|
|
551
|
+
if (params.NetworkBorderGroup !== undefined) {
|
|
552
|
+
awsParams.NetworkBorderGroup = params.NetworkBorderGroup;
|
|
553
|
+
}
|
|
554
|
+
if (params.CustomerOwnedIpv4Pool !== undefined) {
|
|
555
|
+
awsParams.CustomerOwnedIpv4Pool = params.CustomerOwnedIpv4Pool;
|
|
556
|
+
}
|
|
557
|
+
if (params.DryRun !== undefined) {
|
|
558
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
559
|
+
}
|
|
560
|
+
// Handle TagSpecifications
|
|
561
|
+
if (params.TagSpecifications) {
|
|
562
|
+
params.TagSpecifications.forEach((tagSpec, specIndex) => {
|
|
563
|
+
const specNum = specIndex + 1;
|
|
564
|
+
awsParams[`TagSpecification.${specNum}.ResourceType`] =
|
|
565
|
+
tagSpec.ResourceType;
|
|
566
|
+
tagSpec.Tags.forEach((tag, tagIndex) => {
|
|
567
|
+
const tagNum = tagIndex + 1;
|
|
568
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Key`] = tag.Key;
|
|
569
|
+
awsParams[`TagSpecification.${specNum}.Tag.${tagNum}.Value`] =
|
|
570
|
+
tag.Value;
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
return awsParams;
|
|
575
|
+
}
|
|
576
|
+
function convertDescribeAddressesParamsToAwsFormat(params) {
|
|
577
|
+
const awsParams = {};
|
|
578
|
+
if (params.AllocationIds) {
|
|
579
|
+
params.AllocationIds.forEach((id, index) => {
|
|
580
|
+
awsParams[`AllocationId.${index + 1}`] = id;
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
if (params.PublicIps) {
|
|
584
|
+
params.PublicIps.forEach((ip, index) => {
|
|
585
|
+
awsParams[`PublicIp.${index + 1}`] = ip;
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
if (params.Filters) {
|
|
589
|
+
params.Filters.forEach((filter, filterIndex) => {
|
|
590
|
+
const filterNum = filterIndex + 1;
|
|
591
|
+
awsParams[`Filter.${filterNum}.Name`] = filter.Name;
|
|
592
|
+
filter.Values.forEach((value, valueIndex) => {
|
|
593
|
+
awsParams[`Filter.${filterNum}.Value.${valueIndex + 1}`] = value;
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
if (params.DryRun !== undefined) {
|
|
598
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
599
|
+
}
|
|
600
|
+
return awsParams;
|
|
601
|
+
}
|
|
602
|
+
function convertReleaseAddressParamsToAwsFormat(params) {
|
|
603
|
+
const awsParams = {};
|
|
604
|
+
if (params.AllocationId !== undefined) {
|
|
605
|
+
awsParams.AllocationId = params.AllocationId;
|
|
606
|
+
}
|
|
607
|
+
if (params.PublicIp !== undefined) {
|
|
608
|
+
awsParams.PublicIp = params.PublicIp;
|
|
609
|
+
}
|
|
610
|
+
if (params.NetworkBorderGroup !== undefined) {
|
|
611
|
+
awsParams.NetworkBorderGroup = params.NetworkBorderGroup;
|
|
612
|
+
}
|
|
613
|
+
if (params.DryRun !== undefined) {
|
|
614
|
+
awsParams.DryRun = params.DryRun.toString();
|
|
615
|
+
}
|
|
616
|
+
return awsParams;
|
|
617
|
+
}
|
|
618
|
+
//# sourceMappingURL=nat-gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nat-gateway.js","sourceRoot":"","sources":["../../../src/aws/ec2/nat-gateway.ts"],"names":[],"mappings":"AAAA,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;AAE/B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkFzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAChC,iBAAiB,EACjB,KAAK,WAEH,GAAW,EACX,KAAsB;IAEtB,MAAM,QAAQ,GACZ,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC1E,MAAM,aAAa,GAAG,kBAAkB,CACtC,mBAAmB,EACnB,KAAK,CAAC,OAAO,CACd,CAAC;IAEF,IAAI,IAAI,CAAC,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