alchemy 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/bin/alchemy.js +1406 -1464
- package/bin/commands/init.ts +29 -2
- package/bin/services/execute-alchemy.ts +1 -2
- package/lib/alchemy.d.ts +2 -2
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js.map +1 -1
- package/lib/aws/client-props.d.ts +149 -0
- package/lib/aws/client-props.d.ts.map +1 -0
- package/lib/aws/client-props.js +1 -0
- package/lib/aws/client-props.js.map +1 -0
- package/lib/aws/credentials.d.ts +68 -5
- package/lib/aws/credentials.d.ts.map +1 -1
- package/lib/aws/credentials.js +148 -0
- package/lib/aws/credentials.js.map +1 -1
- package/lib/aws/ec2/internet-gateway-attachment.d.ts +57 -3
- package/lib/aws/ec2/internet-gateway-attachment.d.ts.map +1 -1
- package/lib/aws/ec2/internet-gateway-attachment.js +57 -3
- package/lib/aws/ec2/internet-gateway-attachment.js.map +1 -1
- package/lib/aws/ec2/internet-gateway.d.ts +68 -40
- package/lib/aws/ec2/internet-gateway.d.ts.map +1 -1
- package/lib/aws/ec2/internet-gateway.js +68 -40
- package/lib/aws/ec2/internet-gateway.js.map +1 -1
- package/lib/aws/ec2/nat-gateway.d.ts +99 -18
- package/lib/aws/ec2/nat-gateway.d.ts.map +1 -1
- package/lib/aws/ec2/nat-gateway.js +113 -37
- package/lib/aws/ec2/nat-gateway.js.map +1 -1
- package/lib/aws/ec2/route-table-association.d.ts +1 -1
- package/lib/aws/ec2/route-table-association.js +1 -1
- package/lib/aws/ec2/route-table.d.ts +64 -1
- package/lib/aws/ec2/route-table.d.ts.map +1 -1
- package/lib/aws/ec2/route-table.js +64 -1
- package/lib/aws/ec2/route-table.js.map +1 -1
- package/lib/aws/ec2/route.d.ts +60 -1
- package/lib/aws/ec2/route.d.ts.map +1 -1
- package/lib/aws/ec2/route.js +60 -1
- package/lib/aws/ec2/route.js.map +1 -1
- package/lib/aws/ec2/security-group.d.ts +96 -3
- package/lib/aws/ec2/security-group.d.ts.map +1 -1
- package/lib/aws/ec2/security-group.js +96 -3
- package/lib/aws/ec2/security-group.js.map +1 -1
- package/lib/aws/ec2/subnet.d.ts +61 -3
- package/lib/aws/ec2/subnet.d.ts.map +1 -1
- package/lib/aws/ec2/subnet.js +61 -3
- package/lib/aws/ec2/subnet.js.map +1 -1
- package/lib/aws/ec2/utils.d.ts +10 -2
- package/lib/aws/ec2/utils.d.ts.map +1 -1
- package/lib/aws/ec2/utils.js +68 -7
- package/lib/aws/ec2/utils.js.map +1 -1
- package/lib/aws/ec2/vpc.d.ts +50 -2
- package/lib/aws/ec2/vpc.d.ts.map +1 -1
- package/lib/aws/ec2/vpc.js +50 -2
- package/lib/aws/ec2/vpc.js.map +1 -1
- package/lib/aws/index.d.ts +2 -0
- package/lib/aws/index.d.ts.map +1 -1
- package/lib/aws/index.js +2 -0
- package/lib/aws/index.js.map +1 -1
- package/lib/cloudflare/api-response.js +2 -2
- package/lib/cloudflare/api-response.js.map +1 -1
- package/lib/cloudflare/api.d.ts +19 -0
- package/lib/cloudflare/api.d.ts.map +1 -1
- package/lib/cloudflare/api.js +4 -0
- package/lib/cloudflare/api.js.map +1 -1
- package/lib/cloudflare/assets.d.ts.map +1 -1
- package/lib/cloudflare/assets.js +3 -4
- package/lib/cloudflare/assets.js.map +1 -1
- package/lib/cloudflare/bucket.d.ts +5 -3
- package/lib/cloudflare/bucket.d.ts.map +1 -1
- package/lib/cloudflare/bucket.js +22 -18
- package/lib/cloudflare/bucket.js.map +1 -1
- package/lib/cloudflare/bundle/plugin-compat-warning.js +7 -7
- package/lib/cloudflare/bundle/plugin-compat-warning.js.map +1 -1
- package/lib/cloudflare/cloudflare-env-proxy.js.map +1 -1
- package/lib/cloudflare/kv-namespace.d.ts +2 -2
- package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
- package/lib/cloudflare/kv-namespace.js.map +1 -1
- package/lib/cloudflare/oauth.js +3 -3
- package/lib/cloudflare/oauth.js.map +1 -1
- package/lib/cloudflare/quick-tunnel.d.ts +1 -1
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +26 -97
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-bundle.d.ts.map +1 -1
- package/lib/cloudflare/worker-bundle.js +9 -8
- package/lib/cloudflare/worker-bundle.js.map +1 -1
- package/lib/cloudflare/worker-tail.d.ts.map +1 -1
- package/lib/cloudflare/worker-tail.js +6 -6
- package/lib/cloudflare/worker-tail.js.map +1 -1
- package/lib/resource.d.ts +1 -0
- package/lib/resource.d.ts.map +1 -1
- package/lib/resource.js +13 -2
- package/lib/resource.js.map +1 -1
- package/lib/scope.d.ts +24 -23
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +25 -20
- package/lib/scope.js.map +1 -1
- package/lib/state/cloudflare-state-store.d.ts.map +1 -1
- package/lib/state/cloudflare-state-store.js +2 -1
- package/lib/state/cloudflare-state-store.js.map +1 -1
- package/lib/util/idempotent-spawn.d.ts +10 -8
- package/lib/util/idempotent-spawn.d.ts.map +1 -1
- package/lib/util/idempotent-spawn.js +97 -78
- package/lib/util/idempotent-spawn.js.map +1 -1
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/safe-fetch.d.ts +24 -0
- package/lib/util/safe-fetch.d.ts.map +1 -1
- package/lib/util/safe-fetch.js +72 -0
- package/lib/util/safe-fetch.js.map +1 -1
- package/package.json +8 -5
- package/src/alchemy.ts +2 -2
- package/src/aws/client-props.ts +156 -0
- package/src/aws/credentials.ts +165 -4
- package/src/aws/ec2/internet-gateway-attachment.ts +59 -4
- package/src/aws/ec2/internet-gateway.ts +70 -41
- package/src/aws/ec2/nat-gateway.ts +123 -33
- package/src/aws/ec2/route-table-association.ts +1 -1
- package/src/aws/ec2/route-table.ts +66 -2
- package/src/aws/ec2/route.ts +62 -2
- package/src/aws/ec2/security-group.ts +98 -4
- package/src/aws/ec2/subnet.ts +63 -4
- package/src/aws/ec2/utils.ts +73 -7
- package/src/aws/ec2/vpc.ts +52 -3
- package/src/aws/index.ts +2 -0
- package/src/cloudflare/api-response.ts +2 -2
- package/src/cloudflare/api.ts +23 -0
- package/src/cloudflare/assets.ts +3 -4
- package/src/cloudflare/bucket.ts +27 -25
- package/src/cloudflare/bundle/plugin-compat-warning.ts +7 -7
- package/src/cloudflare/cloudflare-env-proxy.ts +2 -2
- package/src/cloudflare/kv-namespace.ts +26 -27
- package/src/cloudflare/oauth.ts +3 -3
- package/src/cloudflare/website.ts +30 -111
- package/src/cloudflare/worker-bundle.ts +9 -8
- package/src/cloudflare/worker-tail.ts +6 -8
- package/src/resource.ts +19 -2
- package/src/scope.ts +73 -43
- package/src/state/cloudflare-state-store.ts +2 -1
- package/src/util/idempotent-spawn.ts +117 -100
- package/src/util/index.ts +1 -0
- package/src/util/safe-fetch.ts +114 -0
|
@@ -16,6 +16,9 @@ import { callEC2Api, createEC2Client } from "./utils.js";
|
|
|
16
16
|
* allowing traffic to flow between the VPC and the internet when combined with proper
|
|
17
17
|
* routing configuration.
|
|
18
18
|
*
|
|
19
|
+
* Supports AWS credential overrides at the resource level, allowing you to deploy Internet Gateway Attachments
|
|
20
|
+
* to different AWS accounts or regions than the default scope configuration.
|
|
21
|
+
*
|
|
19
22
|
* @example
|
|
20
23
|
* // Basic Internet Gateway attachment for internet connectivity
|
|
21
24
|
* const vpc = await Vpc("main-vpc", {
|
|
@@ -30,6 +33,36 @@ import { callEC2Api, createEC2Client } from "./utils.js";
|
|
|
30
33
|
* });
|
|
31
34
|
*
|
|
32
35
|
* @example
|
|
36
|
+
* // Internet Gateway Attachment with AWS credential overrides
|
|
37
|
+
* const crossAccountAttachment = await InternetGatewayAttachment("cross-account-attachment", {
|
|
38
|
+
* internetGateway: igw,
|
|
39
|
+
* vpc: vpc,
|
|
40
|
+
* // Override AWS credentials for this specific resource
|
|
41
|
+
* region: "us-east-1",
|
|
42
|
+
* profile: "production-account",
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Internet Gateway Attachment in different region with role assumption
|
|
47
|
+
* const multiRegionAttachment = await InternetGatewayAttachment("multi-region-attachment", {
|
|
48
|
+
* internetGateway: euIgw,
|
|
49
|
+
* vpc: euVpc,
|
|
50
|
+
* region: "eu-west-1",
|
|
51
|
+
* roleArn: "arn:aws:iam::123456789012:role/CrossRegionRole",
|
|
52
|
+
* roleSessionName: "igw-attachment-deployment",
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Internet Gateway Attachment with explicit credentials
|
|
57
|
+
* const explicitCredsAttachment = await InternetGatewayAttachment("explicit-creds-attachment", {
|
|
58
|
+
* internetGateway: testIgw,
|
|
59
|
+
* vpc: testVpc,
|
|
60
|
+
* accessKeyId: alchemy.secret("AKIAIOSFODNN7EXAMPLE"),
|
|
61
|
+
* secretAccessKey: alchemy.secret("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"),
|
|
62
|
+
* region: "us-west-2",
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
33
66
|
* // Internet Gateway attachment with custom timeout configuration
|
|
34
67
|
* // for environments with slower AWS API responses
|
|
35
68
|
* const attachment = await InternetGatewayAttachment("slow-env-attachment", {
|
|
@@ -58,7 +91,7 @@ import { callEC2Api, createEC2Client } from "./utils.js";
|
|
|
58
91
|
*
|
|
59
92
|
* // Create public subnet and route table for internet access
|
|
60
93
|
* const publicSubnet = await Subnet("public-subnet", {
|
|
61
|
-
* vpc,
|
|
94
|
+
* vpc: vpc,
|
|
62
95
|
* cidrBlock: "10.0.1.0/24",
|
|
63
96
|
* availabilityZone: "us-east-1a"
|
|
64
97
|
* });
|
|
@@ -70,11 +103,32 @@ import { callEC2Api, createEC2Client } from "./utils.js";
|
|
|
70
103
|
* const internetRoute = await Route("internet-route", {
|
|
71
104
|
* routeTable: publicRouteTable,
|
|
72
105
|
* destinationCidrBlock: "0.0.0.0/0",
|
|
73
|
-
*
|
|
106
|
+
* target: { internetGateway: igw }
|
|
107
|
+
* });
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* // Multi-account deployment with scope-level and resource-level overrides
|
|
111
|
+
* await alchemy.run("production", {
|
|
112
|
+
* aws: { region: "us-west-2", profile: "main-account" }
|
|
113
|
+
* }, async () => {
|
|
114
|
+
* // This Internet Gateway Attachment uses scope credentials (main-account, us-west-2)
|
|
115
|
+
* const mainAttachment = await InternetGatewayAttachment("main-attachment", {
|
|
116
|
+
* internetGateway: mainIgw,
|
|
117
|
+
* vpc: mainVpc
|
|
118
|
+
* });
|
|
119
|
+
*
|
|
120
|
+
* // This Internet Gateway Attachment overrides to use different account
|
|
121
|
+
* const crossAccountAttachment = await InternetGatewayAttachment("cross-account-attachment", {
|
|
122
|
+
* internetGateway: crossIgw,
|
|
123
|
+
* vpc: crossVpc,
|
|
124
|
+
* profile: "secondary-account",
|
|
125
|
+
* region: "us-east-1", // Also override region
|
|
126
|
+
* });
|
|
74
127
|
* });
|
|
75
128
|
*/
|
|
76
129
|
export const InternetGatewayAttachment = Resource("aws::InternetGatewayAttachment", async function (_id, props) {
|
|
77
|
-
|
|
130
|
+
// Create EC2 client with credential resolution handled internally
|
|
131
|
+
const client = await createEC2Client(props);
|
|
78
132
|
const timeoutConfig = mergeTimeoutConfig(INTERNET_GATEWAY_ATTACHMENT_TIMEOUT, props.timeout);
|
|
79
133
|
const internetGatewayId = typeof props.internetGateway === "string"
|
|
80
134
|
? props.internetGateway
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internet-gateway-attachment.js","sourceRoot":"","sources":["../../../src/aws/ec2/internet-gateway-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C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,GAAG,CAC1B,CAAC,UAAU,EAAuB,EAAE,CAAC,CAAC;wBACpC,KAAK,EAAE,UAAU,CAAC,KAAK;wBACvB,KAAK,EAAE,UAAU,CAAC,KAAK;qBACxB,CAAC,CACH;oBACD,IAAI,EACF,IAAI,CAAC,MAAM,GAAG,CAAC;wBACb,CAAC,CAAC,IAAI,CAAC,GAAG,CACN,CAAC,GAAG,EAAgB,EAAE,CAAC,CAAC;4BACtB,GAAG,EAAE,GAAG,CAAC,GAAG;4BACZ,KAAK,EAAE,GAAG,CAAC,KAAK;yBACjB,CAAC,CACH;wBACH,CAAC,CAAC,SAAS;oBACf,OAAO,EAAE,GAAG,CAAC,OAAO;iBACrB,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,MAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Context } from "../../context.ts";
|
|
2
2
|
import { Resource } from "../../resource.ts";
|
|
3
3
|
import { type TimeoutConfig } from "../../util/timeout.ts";
|
|
4
|
+
import type { AwsClientProps } from "../client-props.ts";
|
|
4
5
|
/**
|
|
5
6
|
* Properties for creating or updating an Internet Gateway
|
|
6
7
|
*/
|
|
7
|
-
export interface InternetGatewayProps {
|
|
8
|
+
export interface InternetGatewayProps extends AwsClientProps {
|
|
8
9
|
/**
|
|
9
10
|
* Tags to apply to the Internet Gateway
|
|
10
11
|
*/
|
|
@@ -47,12 +48,15 @@ export interface InternetGateway extends Resource<"aws::InternetGateway">, Inter
|
|
|
47
48
|
* 1. Provide a target in your VPC route tables for internet-routable traffic
|
|
48
49
|
* 2. Perform network address translation (NAT) for instances with public IPv4 addresses
|
|
49
50
|
*
|
|
51
|
+
* Supports AWS credential overrides at the resource level, allowing you to deploy Internet Gateways
|
|
52
|
+
* to different AWS accounts or regions than the default scope configuration.
|
|
53
|
+
*
|
|
50
54
|
* @example
|
|
51
55
|
* ```typescript
|
|
52
56
|
* // Create a basic Internet Gateway
|
|
53
|
-
* const igw =
|
|
57
|
+
* const igw = await InternetGateway("main-igw", {
|
|
54
58
|
* tags: {
|
|
55
|
-
* Name: "
|
|
59
|
+
* Name: "main-internet-gateway",
|
|
56
60
|
* Environment: "production"
|
|
57
61
|
* }
|
|
58
62
|
* });
|
|
@@ -60,59 +64,49 @@ export interface InternetGateway extends Resource<"aws::InternetGateway">, Inter
|
|
|
60
64
|
*
|
|
61
65
|
* @example
|
|
62
66
|
* ```typescript
|
|
63
|
-
* // Create Internet Gateway with
|
|
64
|
-
* const
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* // Create Internet Gateway with AWS credential overrides
|
|
68
|
+
* const crossAccountIgw = await InternetGateway("cross-account-igw", {
|
|
69
|
+
* // Override AWS credentials for this specific resource
|
|
70
|
+
* region: "us-east-1",
|
|
71
|
+
* profile: "production-account",
|
|
72
|
+
* tags: {
|
|
73
|
+
* Name: "cross-account-internet-gateway",
|
|
74
|
+
* Environment: "production"
|
|
69
75
|
* }
|
|
70
76
|
* });
|
|
71
77
|
* ```
|
|
72
78
|
*
|
|
73
79
|
* @example
|
|
74
80
|
* ```typescript
|
|
75
|
-
* // Create Internet Gateway
|
|
76
|
-
* const
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* vpcId: vpc.vpcId
|
|
81
|
-
* });
|
|
82
|
-
* ```
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```typescript
|
|
86
|
-
* // Access Internet Gateway properties
|
|
87
|
-
* const igw = new InternetGateway({ tags: { Name: "example-igw" } });
|
|
88
|
-
* logger.log(`Internet Gateway ID: ${igw.internetGatewayId}`);
|
|
89
|
-
* logger.log(`State: ${igw.state}`);
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* Creates and manages Internet Gateways that provide internet access to VPCs.
|
|
93
|
-
* Note: Use InternetGatewayAttachment to attach the gateway to a VPC.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* // Create a basic Internet Gateway
|
|
97
|
-
* const igw = await InternetGateway("main-igw", {
|
|
81
|
+
* // Create Internet Gateway in different region with role assumption
|
|
82
|
+
* const multiRegionIgw = await InternetGateway("multi-region-igw", {
|
|
83
|
+
* region: "eu-west-1",
|
|
84
|
+
* roleArn: "arn:aws:iam::123456789012:role/CrossRegionRole",
|
|
85
|
+
* roleSessionName: "internet-gateway-deployment",
|
|
98
86
|
* tags: {
|
|
99
|
-
* Name: "
|
|
100
|
-
*
|
|
87
|
+
* Name: "eu-internet-gateway",
|
|
88
|
+
* Region: "europe"
|
|
101
89
|
* }
|
|
102
90
|
* });
|
|
91
|
+
* ```
|
|
103
92
|
*
|
|
104
93
|
* @example
|
|
105
|
-
*
|
|
106
|
-
*
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // Create Internet Gateway with explicit credentials
|
|
96
|
+
* const explicitCredsIgw = await InternetGateway("explicit-creds-igw", {
|
|
97
|
+
* accessKeyId: alchemy.secret("AKIAIOSFODNN7EXAMPLE"),
|
|
98
|
+
* secretAccessKey: alchemy.secret("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"),
|
|
99
|
+
* region: "us-west-2",
|
|
107
100
|
* tags: {
|
|
108
|
-
* Name: "
|
|
109
|
-
*
|
|
110
|
-
* Team: "backend"
|
|
101
|
+
* Name: "explicit-credentials-igw",
|
|
102
|
+
* Purpose: "testing"
|
|
111
103
|
* }
|
|
112
104
|
* });
|
|
105
|
+
* ```
|
|
113
106
|
*
|
|
114
107
|
* @example
|
|
115
|
-
*
|
|
108
|
+
* ```typescript
|
|
109
|
+
* // Create Internet Gateway with custom timeout configuration
|
|
116
110
|
* const customIgw = await InternetGateway("custom-igw", {
|
|
117
111
|
* timeout: {
|
|
118
112
|
* maxAttempts: 90,
|
|
@@ -123,6 +117,40 @@ export interface InternetGateway extends Resource<"aws::InternetGateway">, Inter
|
|
|
123
117
|
* Purpose: "high-availability"
|
|
124
118
|
* }
|
|
125
119
|
* });
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* // Create Internet Gateway and attach to VPC
|
|
125
|
+
* const vpc = await VPC("main-vpc", { cidrBlock: "10.0.0.0/16" });
|
|
126
|
+
* const igw = await InternetGateway("vpc-igw", {
|
|
127
|
+
* tags: { Name: "vpc-internet-gateway" }
|
|
128
|
+
* });
|
|
129
|
+
* const attachment = await InternetGatewayAttachment("igw-attachment", {
|
|
130
|
+
* internetGatewayId: igw.internetGatewayId,
|
|
131
|
+
* vpcId: vpc.vpcId
|
|
132
|
+
* });
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* // Multi-account deployment with scope-level and resource-level overrides
|
|
138
|
+
* await alchemy.run("production", {
|
|
139
|
+
* aws: { region: "us-west-2", profile: "main-account" }
|
|
140
|
+
* }, async () => {
|
|
141
|
+
* // This IGW uses scope credentials (main-account, us-west-2)
|
|
142
|
+
* const mainIgw = await InternetGateway("main-igw", {
|
|
143
|
+
* tags: { Name: "main-account-igw" }
|
|
144
|
+
* });
|
|
145
|
+
*
|
|
146
|
+
* // This IGW overrides to use different account
|
|
147
|
+
* const crossAccountIgw = await InternetGateway("cross-account-igw", {
|
|
148
|
+
* profile: "secondary-account",
|
|
149
|
+
* region: "us-east-1", // Also override region
|
|
150
|
+
* tags: { Name: "secondary-account-igw" }
|
|
151
|
+
* });
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
126
154
|
*/
|
|
127
155
|
export declare const InternetGateway: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<InternetGateway>, _id: string, props: InternetGatewayProps) => Promise<InternetGateway>);
|
|
128
156
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internet-gateway.d.ts","sourceRoot":"","sources":["../../../src/aws/ec2/internet-gateway.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;
|
|
1
|
+
{"version":3,"file":"internet-gateway.d.ts","sourceRoot":"","sources":["../../../src/aws/ec2/internet-gateway.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;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,eACf,SAAQ,QAAQ,CAAC,sBAAsB,CAAC,EACtC,oBAAoB;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;KAC5D,CAAC,CAAC;IAEH;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+GG;AACH,eAAO,MAAM,eAAe,yFAGlB,OAAO,CAAC,eAAe,CAAC,OACzB,MAAM,SACJ,oBAAoB,KAC1B,OAAO,CAAC,eAAe,CAAC,CAiH5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAGtC,CAAC"}
|
|
@@ -53,12 +53,15 @@ async function waitForInternetGatewayDeleted(client, internetGatewayId, timeoutC
|
|
|
53
53
|
* 1. Provide a target in your VPC route tables for internet-routable traffic
|
|
54
54
|
* 2. Perform network address translation (NAT) for instances with public IPv4 addresses
|
|
55
55
|
*
|
|
56
|
+
* Supports AWS credential overrides at the resource level, allowing you to deploy Internet Gateways
|
|
57
|
+
* to different AWS accounts or regions than the default scope configuration.
|
|
58
|
+
*
|
|
56
59
|
* @example
|
|
57
60
|
* ```typescript
|
|
58
61
|
* // Create a basic Internet Gateway
|
|
59
|
-
* const igw =
|
|
62
|
+
* const igw = await InternetGateway("main-igw", {
|
|
60
63
|
* tags: {
|
|
61
|
-
* Name: "
|
|
64
|
+
* Name: "main-internet-gateway",
|
|
62
65
|
* Environment: "production"
|
|
63
66
|
* }
|
|
64
67
|
* });
|
|
@@ -66,59 +69,49 @@ async function waitForInternetGatewayDeleted(client, internetGatewayId, timeoutC
|
|
|
66
69
|
*
|
|
67
70
|
* @example
|
|
68
71
|
* ```typescript
|
|
69
|
-
* // Create Internet Gateway with
|
|
70
|
-
* const
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
72
|
+
* // Create Internet Gateway with AWS credential overrides
|
|
73
|
+
* const crossAccountIgw = await InternetGateway("cross-account-igw", {
|
|
74
|
+
* // Override AWS credentials for this specific resource
|
|
75
|
+
* region: "us-east-1",
|
|
76
|
+
* profile: "production-account",
|
|
77
|
+
* tags: {
|
|
78
|
+
* Name: "cross-account-internet-gateway",
|
|
79
|
+
* Environment: "production"
|
|
75
80
|
* }
|
|
76
81
|
* });
|
|
77
82
|
* ```
|
|
78
83
|
*
|
|
79
84
|
* @example
|
|
80
85
|
* ```typescript
|
|
81
|
-
* // Create Internet Gateway
|
|
82
|
-
* const
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* vpcId: vpc.vpcId
|
|
87
|
-
* });
|
|
88
|
-
* ```
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* // Access Internet Gateway properties
|
|
93
|
-
* const igw = new InternetGateway({ tags: { Name: "example-igw" } });
|
|
94
|
-
* logger.log(`Internet Gateway ID: ${igw.internetGatewayId}`);
|
|
95
|
-
* logger.log(`State: ${igw.state}`);
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* Creates and manages Internet Gateways that provide internet access to VPCs.
|
|
99
|
-
* Note: Use InternetGatewayAttachment to attach the gateway to a VPC.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* // Create a basic Internet Gateway
|
|
103
|
-
* const igw = await InternetGateway("main-igw", {
|
|
86
|
+
* // Create Internet Gateway in different region with role assumption
|
|
87
|
+
* const multiRegionIgw = await InternetGateway("multi-region-igw", {
|
|
88
|
+
* region: "eu-west-1",
|
|
89
|
+
* roleArn: "arn:aws:iam::123456789012:role/CrossRegionRole",
|
|
90
|
+
* roleSessionName: "internet-gateway-deployment",
|
|
104
91
|
* tags: {
|
|
105
|
-
* Name: "
|
|
106
|
-
*
|
|
92
|
+
* Name: "eu-internet-gateway",
|
|
93
|
+
* Region: "europe"
|
|
107
94
|
* }
|
|
108
95
|
* });
|
|
96
|
+
* ```
|
|
109
97
|
*
|
|
110
98
|
* @example
|
|
111
|
-
*
|
|
112
|
-
*
|
|
99
|
+
* ```typescript
|
|
100
|
+
* // Create Internet Gateway with explicit credentials
|
|
101
|
+
* const explicitCredsIgw = await InternetGateway("explicit-creds-igw", {
|
|
102
|
+
* accessKeyId: alchemy.secret("AKIAIOSFODNN7EXAMPLE"),
|
|
103
|
+
* secretAccessKey: alchemy.secret("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"),
|
|
104
|
+
* region: "us-west-2",
|
|
113
105
|
* tags: {
|
|
114
|
-
* Name: "
|
|
115
|
-
*
|
|
116
|
-
* Team: "backend"
|
|
106
|
+
* Name: "explicit-credentials-igw",
|
|
107
|
+
* Purpose: "testing"
|
|
117
108
|
* }
|
|
118
109
|
* });
|
|
110
|
+
* ```
|
|
119
111
|
*
|
|
120
112
|
* @example
|
|
121
|
-
*
|
|
113
|
+
* ```typescript
|
|
114
|
+
* // Create Internet Gateway with custom timeout configuration
|
|
122
115
|
* const customIgw = await InternetGateway("custom-igw", {
|
|
123
116
|
* timeout: {
|
|
124
117
|
* maxAttempts: 90,
|
|
@@ -129,9 +122,44 @@ async function waitForInternetGatewayDeleted(client, internetGatewayId, timeoutC
|
|
|
129
122
|
* Purpose: "high-availability"
|
|
130
123
|
* }
|
|
131
124
|
* });
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```typescript
|
|
129
|
+
* // Create Internet Gateway and attach to VPC
|
|
130
|
+
* const vpc = await VPC("main-vpc", { cidrBlock: "10.0.0.0/16" });
|
|
131
|
+
* const igw = await InternetGateway("vpc-igw", {
|
|
132
|
+
* tags: { Name: "vpc-internet-gateway" }
|
|
133
|
+
* });
|
|
134
|
+
* const attachment = await InternetGatewayAttachment("igw-attachment", {
|
|
135
|
+
* internetGatewayId: igw.internetGatewayId,
|
|
136
|
+
* vpcId: vpc.vpcId
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* // Multi-account deployment with scope-level and resource-level overrides
|
|
143
|
+
* await alchemy.run("production", {
|
|
144
|
+
* aws: { region: "us-west-2", profile: "main-account" }
|
|
145
|
+
* }, async () => {
|
|
146
|
+
* // This IGW uses scope credentials (main-account, us-west-2)
|
|
147
|
+
* const mainIgw = await InternetGateway("main-igw", {
|
|
148
|
+
* tags: { Name: "main-account-igw" }
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* // This IGW overrides to use different account
|
|
152
|
+
* const crossAccountIgw = await InternetGateway("cross-account-igw", {
|
|
153
|
+
* profile: "secondary-account",
|
|
154
|
+
* region: "us-east-1", // Also override region
|
|
155
|
+
* tags: { Name: "secondary-account-igw" }
|
|
156
|
+
* });
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
132
159
|
*/
|
|
133
160
|
export const InternetGateway = Resource("aws::InternetGateway", async function (_id, props) {
|
|
134
|
-
|
|
161
|
+
// Create EC2 client with credential resolution handled internally
|
|
162
|
+
const client = await createEC2Client(props);
|
|
135
163
|
const timeoutConfig = mergeTimeoutConfig(INTERNET_GATEWAY_TIMEOUT, props.timeout);
|
|
136
164
|
if (this.phase === "delete") {
|
|
137
165
|
if (this.output?.internetGatewayId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internet-gateway.js","sourceRoot":"","sources":["../../../src/aws/ec2/internet-gateway.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;
|
|
1
|
+
{"version":3,"file":"internet-gateway.js","sourceRoot":"","sources":["../../../src/aws/ec2/internet-gateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;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C;aAAM,CAAC;YACN,MAAM,CAAC,gBAAgB,GAAG,EAAE,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,IACE,MAAM,CAAC,6BAA6B;QACpC,MAAM,CAAC,6BAA6B;QACpC,MAAM,CAAC,6BAA6B,EACpC,CAAC;QACD,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,MAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Context } from "../../context.ts";
|
|
2
2
|
import { Resource } from "../../resource.ts";
|
|
3
3
|
import { type TimeoutConfig } from "../../util/timeout.ts";
|
|
4
|
+
import type { AwsClientProps } from "../client-props.ts";
|
|
4
5
|
import type { Subnet } from "./subnet.ts";
|
|
5
6
|
/**
|
|
6
7
|
* Properties for creating or updating a NAT Gateway
|
|
7
8
|
*/
|
|
8
|
-
export interface NatGatewayProps {
|
|
9
|
+
export interface NatGatewayProps extends AwsClientProps {
|
|
9
10
|
/**
|
|
10
11
|
* The subnet to create the NAT Gateway in (must be a public subnet)
|
|
11
12
|
*/
|
|
@@ -75,39 +76,94 @@ export interface NatGateway extends Resource<"aws::NatGateway">, NatGatewayProps
|
|
|
75
76
|
* if one is not provided. NAT Gateways are slow resources that can take
|
|
76
77
|
* up to 10 minutes to become available.
|
|
77
78
|
*
|
|
79
|
+
* Supports AWS credential overrides at the resource level, allowing you to deploy NAT Gateways
|
|
80
|
+
* to different AWS accounts or regions than the default scope configuration.
|
|
81
|
+
*
|
|
78
82
|
* @example
|
|
83
|
+
* ```typescript
|
|
79
84
|
* // Create a NAT Gateway with automatic Elastic IP allocation
|
|
80
85
|
* const natGateway = await NatGateway("main-nat", {
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
+
* subnet: publicSubnet,
|
|
87
|
+
* tags: {
|
|
88
|
+
* Name: "main-nat-gateway",
|
|
89
|
+
* Environment: "production"
|
|
90
|
+
* }
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* // Create NAT Gateway with AWS credential overrides
|
|
97
|
+
* const crossAccountNat = await NatGateway("cross-account-nat", {
|
|
98
|
+
* subnet: publicSubnet,
|
|
99
|
+
* // Override AWS credentials for this specific resource
|
|
100
|
+
* region: "us-east-1",
|
|
101
|
+
* profile: "production-account",
|
|
102
|
+
* tags: {
|
|
103
|
+
* Name: "cross-account-nat-gateway",
|
|
104
|
+
* Environment: "production"
|
|
105
|
+
* }
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* // Create NAT Gateway in different region with role assumption
|
|
112
|
+
* const multiRegionNat = await NatGateway("multi-region-nat", {
|
|
113
|
+
* subnet: euPublicSubnet,
|
|
114
|
+
* region: "eu-west-1",
|
|
115
|
+
* roleArn: "arn:aws:iam::123456789012:role/CrossRegionRole",
|
|
116
|
+
* roleSessionName: "nat-gateway-deployment",
|
|
117
|
+
* tags: {
|
|
118
|
+
* Name: "eu-nat-gateway",
|
|
119
|
+
* Region: "europe"
|
|
120
|
+
* }
|
|
86
121
|
* });
|
|
122
|
+
* ```
|
|
87
123
|
*
|
|
88
124
|
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* // Create NAT Gateway with explicit credentials
|
|
127
|
+
* const explicitCredsNat = await NatGateway("explicit-creds-nat", {
|
|
128
|
+
* subnet: testPublicSubnet,
|
|
129
|
+
* accessKeyId: alchemy.secret("AKIAIOSFODNN7EXAMPLE"),
|
|
130
|
+
* secretAccessKey: alchemy.secret("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"),
|
|
131
|
+
* region: "us-west-2",
|
|
132
|
+
* tags: {
|
|
133
|
+
* Name: "explicit-credentials-nat",
|
|
134
|
+
* Purpose: "testing"
|
|
135
|
+
* }
|
|
136
|
+
* });
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
89
141
|
* // Create a NAT Gateway with existing Elastic IP
|
|
90
142
|
* const natGateway = await NatGateway("custom-nat", {
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
143
|
+
* subnet: "subnet-12345678",
|
|
144
|
+
* allocationId: "eipalloc-12345678",
|
|
145
|
+
* connectivityType: "public",
|
|
146
|
+
* tags: {
|
|
147
|
+
* Name: "custom-nat-gateway"
|
|
148
|
+
* }
|
|
97
149
|
* });
|
|
150
|
+
* ```
|
|
98
151
|
*
|
|
99
152
|
* @example
|
|
153
|
+
* ```typescript
|
|
100
154
|
* // Create a private NAT Gateway (for VPC-to-VPC communication)
|
|
101
155
|
* const privateNat = await NatGateway("private-nat", {
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
156
|
+
* subnet: privateSubnet,
|
|
157
|
+
* connectivityType: "private",
|
|
158
|
+
* tags: {
|
|
159
|
+
* Name: "private-nat-gateway",
|
|
160
|
+
* Type: "internal"
|
|
161
|
+
* }
|
|
108
162
|
* });
|
|
163
|
+
* ```
|
|
109
164
|
*
|
|
110
165
|
* @example
|
|
166
|
+
* ```typescript
|
|
111
167
|
* // Create a NAT Gateway with custom timeout configuration
|
|
112
168
|
* const slowNat = await NatGateway("slow-nat", {
|
|
113
169
|
* subnet: publicSubnet,
|
|
@@ -119,8 +175,32 @@ export interface NatGateway extends Resource<"aws::NatGateway">, NatGatewayProps
|
|
|
119
175
|
* Name: "slow-nat-gateway"
|
|
120
176
|
* }
|
|
121
177
|
* });
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* // Multi-account deployment with scope-level and resource-level overrides
|
|
183
|
+
* await alchemy.run("production", {
|
|
184
|
+
* aws: { region: "us-west-2", profile: "main-account" }
|
|
185
|
+
* }, async () => {
|
|
186
|
+
* // This NAT Gateway uses scope credentials (main-account, us-west-2)
|
|
187
|
+
* const mainNat = await NatGateway("main-nat", {
|
|
188
|
+
* subnet: mainPublicSubnet,
|
|
189
|
+
* tags: { Name: "main-account-nat" }
|
|
190
|
+
* });
|
|
191
|
+
*
|
|
192
|
+
* // This NAT Gateway overrides to use different account
|
|
193
|
+
* const crossAccountNat = await NatGateway("cross-account-nat", {
|
|
194
|
+
* subnet: crossPublicSubnet,
|
|
195
|
+
* profile: "secondary-account",
|
|
196
|
+
* region: "us-east-1", // Also override region
|
|
197
|
+
* tags: { Name: "secondary-account-nat" }
|
|
198
|
+
* });
|
|
199
|
+
* });
|
|
200
|
+
* ```
|
|
122
201
|
*
|
|
123
202
|
* @example
|
|
203
|
+
* ```typescript
|
|
124
204
|
* // Use NAT Gateway in route table for private subnet internet access
|
|
125
205
|
* const privateRoute = await Route("private-internet", {
|
|
126
206
|
* routeTable: privateRouteTable,
|
|
@@ -130,6 +210,7 @@ export interface NatGateway extends Resource<"aws::NatGateway">, NatGatewayProps
|
|
|
130
210
|
* Name: "private-to-internet"
|
|
131
211
|
* }
|
|
132
212
|
* });
|
|
213
|
+
* ```
|
|
133
214
|
*/
|
|
134
215
|
export declare const NatGateway: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<NatGateway>, _id: string, props: NatGatewayProps) => Promise<NatGateway>);
|
|
135
216
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nat-gateway.d.ts","sourceRoot":"","sources":["../../../src/aws/ec2/nat-gateway.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAEL,KAAK,aAAa,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